C # usercontrol Problems

Source: Internet
Author: User

1. defaultvalue: it does not provide the default value during design. It is the same as the value you entered and the value you set. The value remains unchanged and is displayed in bold ].
[Description ("value of label1 ")
, Defaultvalue ("label123 ")
]
Public String code
{
Get {return label1.text ;}
Set {label1.text = value ;}
}

If label1.text is not equal to "label123", the value of the Code attribute displayed in IDE is in bold (indicating that the attribute value is changed if it is different from the default value)

2. vs.net 2005 incorrect path format

This problem seems to be a bug in MS, which often occurs when custom controls or UIS change.

The solution is generally:

First: recompileProgram(F6)

Second, the solution is extremely simple.

Switch to frmmanagebase. CS and find
Public frmmanagebase ()
{
Initializecomponent ();
}

Click Enter here or outside, or anywhere in the CS file!

This is found on the Internet, that is, you can change something in the wrong form and save it.

If it still does not work, you can try to turn off the project and re-open it (remember to save it)

3. Set the default event of the control:

[Defaultproperty ("code2"), defaultevent ("usercontrolclicked")]
Public partial class usercontrol1: usercontrol
{

 

 

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.