Designerserializationvisibility: Specify the persistence type used for property serialization on the component during design:
That is to say: Set whether to generate the corresponding data in the initializecomponent FunctionCode
Today, a user control is implemented, that is, a button1 is put on a new usercontrol, and the text attribute of button1 is changed by rewriting the text attribute to set the text attribute of usercontrol, however, the text of usercontrl disappears at the beginning regardless of the settings. visible)] can be automatically generated in the initializecomponent function. TEXT = "...... "Code to achieve this.
[Browsable (true), designonly (false), designerserializationvisibility (designerserializationvisibility. Visible)]
Public override string text
{
Get
{
Return this. button1.text;
}
Set
{
This. button1.text = value;
}
}
Share: