Usercontrol-set whether to generate the corresponding code in the initializecomponent Function

Source: Internet
Author: User

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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.