|
-
May 5th, 2012, 09:09 PM
#1
Extending Generic Control
I would like to add properties to controls of every type. For example, each generic control has a "Tag" property. I'd like to add a property "ControlDescription" and some others to do some things that really will not help to explain.
I know how to create extended versions of each TYPE of control, one by one. I can do the button, the radioButton, the checkBox, etc. But that would be a lot of duplicitous coding, not to mention duplicitous upkeep.
On a one by one basis, you can do this:
CustomLabel myLabel=new CustomLabel();
But to extend all controls, you can't do this:
Label myLabel=new CustomControl() ** hoping that Label will inherit from Control since CustomControl() inherits from Control.
How can I do what I want?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|