Overriding the Text Property of a WinForms UserControl

From Rockford Lhotka:

“Every time I go to override the Text property in a Windows Forms UserControl I have to go find this one little attribute that I can never remember…

It is easy enough to remember to make the property Browsable(true), but it is that other attribute that’s hard to remember: DesignerSerializationVisibility(DesignerSerializationVisibility.Visible).

This web page not only answers the question, but includes a nice summary of all the System.ComponentModel attributes.

At least next time I know I can search my own blog to find the answer :)”

One comment

Comments are closed.