.net - How do I get a User Control's name to display in the designer? -
some of standard windows forms controls display name in designer. listbox, example, display dummy item when added to form, , item has name set specific listbox. if change listbox's name "thefirstlistbox", text "thefirstlistbox" displayed inside it.
if create usercontrol , try display name inside it, either in constructor or in load event handler, type's name (which assume original name specific instance) displayed. if type myusercontrol , instance's name set "thefirstusercontrol", "myusercontrol" displayed in designer.
i thought may expected override onnamechanged method or add listener namechanged event , change displayed text in there neither of these exist , if did think wouldn't solution.
how can string displayed inside usercontrol in designer (and not @ runtime) change when instance's name changes?
note: have method detects whether control being instantiated in designer, , works. detecting whether i'm in designer isn't problem.
Comments
Post a Comment