UserControl的Text默认被隐藏了,即加了[BrowsableAttribute(false)], 你重写的时候要加上[BrowsableAttribute(true)] 以下为C#代码 [BrowsableAttribute(true)] public override string Text { get { return base.Text; } set { base.Text = value; } }楼主貌似使用的是VB的,可以这样<BrowsableAttribute(True)> _ Public Overrides Property Text As String Get Set
Public string MyText
{
get
{
return txt1.Text;
}
set
{
txt1.Text
}
}放到你自定义控件的类文件中
Public string MyText
{
get
{
return txt1.Text;
}
set
{
txt1.Text=Value;
}
}
//txt1 你自定义控件上面的TextBox
你重写的时候要加上[BrowsableAttribute(true)]
以下为C#代码 [BrowsableAttribute(true)]
public override string Text
{
get
{
return base.Text;
}
set
{
base.Text = value;
}
}楼主貌似使用的是VB的,可以这样<BrowsableAttribute(True)> _
Public Overrides Property Text As String
Get
Set