spacer
Yehuda Shiran September 8, 2002
Implementing the OnMouseUp Event Handler
Tips: September 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Google Going Native With Chrome
Mozilla Fixes Firefox Flaws as 3.5 Release Nears
Microsoft and Novell Still Bosom Buddies

Suppose you want to override the OnMouseUp event within a certain panel of the docking windows application. First, you need to define the new overriding class:

  class ClickPanel extends System.Windows.Forms.Panel {
    override protected function OnMouseUp (e : MouseEventArgs) {
      super.OnMouseUp(e);
      MessageBox.Show("Mouse Up at: "+e.X+", "+ e.Y);
    } 
  } 
Then, you need to change the top panel to behave as the ClickPanel class, instead of the generic Panel class. We first change its definition:

  private var topPanel: ClickPanel;
And then we need to change its construction statement:

  topPanel= new ClickPanel;
You pop up the window by calling the Application.Run() method. If the package name is say MouseUpPkg and the class name is MouseUpCls, the running statement is:

  Application.Run(new MouseUpPkg.MouseUpCls());
Whenever you click inside the top panel, a message box will pop up with the event coordinates, like this:

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:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
XML and PHP Simplified · Creating a ASP.NET Contact Form · Data Filtering with PHP
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Intel to Host Live Nehalem Q&A · 12 Tips to Troubleshoot Network File-Sharing · 10 Tips for Selling on Kijiji