any way to extend all controls?

  • Thread starter Thread starter khorad
  • Start date Start date
K

khorad

i feel like there should be a way to do this and i'm just blind for not
seeing it

i want to add a 'userdata' property to all controls, it would act just like
the text property but it would hold an object instead of being limited to
text

i could write a wrapper for each control individually but that seems like a
waste (not to mention probably not being automatically supported by the form
designer). It would be better to somehow extend/modify the control class
which all controls inherit from
 
Unfortunately most of the control classes are sealed and you cannot extend
them.
 
I would like to add that, on the desktop (nearly everything seems to have
been removed from the compact version .... sigh...) there is the Tag
property, defined in Control

otherwise, depending on what you do, you could have a
Hashtable[Control]=object
 
Back
Top