recursive
recursive

Reputation: 86084

How can I get an overridden Text property of my user control to show up in the form designer in VS2005?

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?

Upvotes: 2

Views: 1460

Answers (1)

Jim H.
Jim H.

Reputation: 5579

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.

Upvotes: 6

Related Questions