Tuesday, October 18, 2011

VS2010 User Control - Text Property

In VS2010, Text property in user control are not visible by default.
Adding Browsable(true) attribute will display the Text property in properties window but the value was not stored in designer file (xxxx.designer.cs).

Solutions:
 
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[Bindable(true)]
public override string Text ... 
 

Appreciation

Do you like our work? Appreciate if you could help to buy us a cup of coffee. Thank you.