Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subclassing All Base Controls
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00642367
Message ID:
00642883
Views:
15
Hi Thomas,
I cant realy use this because im using this control on a form. IF i use this OnClick Event the it becomes the forms onclick event.

Regards,
Fred
>>>in my base class I have this code
>>>
>>>protected override void OnClick(System.EventArgs e)
>>> {
>>> MessageBox.Show("Base Class");
>>> }
>>>
>>>
>>
>>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcwlkEventsTutorial.asp
>>"Events and Inheritance
>>When creating a general component that can be derived from, what seems to be a problem sometimes arises with events. Since events can only be invoked from within the class that declared them, derived classes cannot directly invoke events declared within the base class. Although this is sometimes what is desired, often it is appropriate to give the derived class the freedom to invoke the event. This is typically done by creating a protected invoking method for the event. By calling this invoking method, derived classes can invoke the event. For even more flexibility, the invoking method is often declared as virtual, which allows the derived class to override it. This allows the derived class to intercept the events that the base class is invoking, possibly doing its own processing of them.
>>"
>>
>>Does calling the base event from the derived OnClick work?
>>
>>protected override void OnClick(System.EventArgs e)
>>		{
>>                        base.Onclick(e);
>>			MessageBox.Show("Base Class");
>>		}
>>
>
>David;
>
>Good source of information!
>
>>possibly doing its own processing of them<
>
>Now this is an interesting statement, possibly. Perhaps? Maybe? Sometimes? Gee, this sounds like it may work or may not – just another “Browser Experience”? :)
>
>Tom
Fred Besterwitch, MCP

The harder you work. The luckier you get.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform