Home All Groups Group Topic Archive Search About
Author
8 Mar 2006 11:45 AM
M Nauman Ur Rehman
Hi,

I have derived a class from Button class.
I've overridden the click event of my derived class.
Now I want the user to use only my click event rather than he overriding it.

In simple words, I dont want the user of my control to override the click
event of my button class derived class

Thanks in advance
Regards
Nauman

Author
8 Mar 2006 1:06 PM
Wouter van Vugt
use:

protected sealed override void OnClick(EventArgs e)

in your class.
Author
9 Mar 2006 5:41 AM
M Nauman Ur Rehman
Hi,

Thanks for the help.
I've used sealed and stopped the user form overriding the OnClick event. But
is there a way to hide the event from the event list in the property
browser?
And also when the user double clicks on the control it by default takes to
the "mycontrol_click" in code behind. how do I stop this behavior?

Regards
Nauman

Show quoteHide quote
"Wouter van Vugt" <wout***@infosupport.com> wrote in message
news:1141823196.345667.170050@z34g2000cwc.googlegroups.com...
> use:
>
> protected sealed override void OnClick(EventArgs e)
>
> in your class.
>