Greg...that's what i was afraid of...yeh..good idea..will create my own
toolbox with derived controls....mmm...now i have to do a search and replace
on my current project J

 

From: [email protected] [mailto:[email protected]]
On Behalf Of Greg Keogh
Sent: Friday, 29 April 2011 5:40 AM
To: 'ozDotNet'
Subject: RE: Is it possible to override a class?

 

Anthony, it sounds like you do actually want to derive a new class. A
control is just a class. In large WinForm apps I usually create FooLabel,
FooButton, FooPanel, etc classes and use them in place of the usual base
classes. My FooLabel could detect a settings change for example and they
would all change colour or font. Your derived FooButton would optionally
beep when clicked.

 

The only nuisance is keeping all the Foo controls in the toolbox and
remembering to use them consistently.

 

Greg

Reply via email to