Add click event to a control that does not have one

  • Thread starter Thread starter Lennart Nielsen
  • Start date Start date
Hi Lennart,

just declare a new class MyErrorProvider, which inherits
from ErrorProvider.
Then you can define additional events.

After compiling the MyErrorProvider will appear in the toolbox.

Regards
Bernd

Public Class MyErrorProvider
Inherits ErrorProvider


End Class
 
Hi Bernd,

Yes I know that I will have to do this; it is however creating or capturing
the click event I have trouble with.

If you have an example or can guide me towards a source, I'd be grateful.

Lennart
 
Lennart said:
Is that possible? The control in question is the ErrorProvider.

If the base control really doesn't support "Click" then you'll have to
subclass (inherit from) it, override the WndProc method and catch the
individual Windows-level Message(s) associated with clicking.

HTH,
Phill W.
 
Back
Top