How can I get an overridden Text property of my user control to show up in the form designer in VS2005?
-
05-09-2019 - |
Question
I have a user control with the following code in it.
[System.ComponentModel.Category("Appearance")]
public override string Text { ... }
private int myVar;
[System.ComponentModel.Category("Appearance")]
public int MyProperty { ... }
MyProperty
shows up in the property grid when the control is inserted in a form, but Text
does not. How can I get it visible?
Solution
If you add the System.ComponentModel.Browsable(true) attribute to your property it should show up in the property browser. Using your example above I confirmed the behavior in VS2008.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow