|
September 7, 2002 Overriding an Event Handler Tips: September 2002
Yehuda Shiran, Ph.D.
|
|
Sometimes you want to override an event handler of a class you inherit. Suppose you want to redefine the function OnMouseUp() of the class System.Windows.Forms.Panel, by adding a message that displays the coordinates of the event. You need to define a new class, say ClickPanel, which extends the class System.Windows.Forms.Panel. You need to:
You may want to specify that the new function is overriding the super class and is protected against further overriding by other classes that may inherit it:
Integrating into the class ClickPanel:
To learn more about JScript .NET and ASP.NET, go to Column 117, JScript .NET, Part XI: Creating Windows Forms.
People who read this tip also read these tips: Look for similar tips by subject: |