因为此类还没有实例化,所以不能设置其text值.希望在其实例化时提供一个默认的值. public class NumberTextBox : TextBox { static NumberTextBox() { } }