If you have a user control with a field like public int number = 10; can you make that value come up in the properties box when you use the designer in VS 2010 and C#?
If you have a user control with a field like public int number =
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to turn your variable into a property. Try adding Get Set and sometimes you have to add the proper attributes (referencing the System.ComponentModel class)
Note: The DefaultValue attribute is for setting the designer to bold or not. It doesn’t actually set the default value.