spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column117


JScript .NET, Part XI: Creating Windows Forms

Finance Developer (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume
Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans


Handling Click Events

In this page, we demonstrate adding an event handler to a button. We add this capability on top of Page 5's Windows form. First, we add the event handler button1_Clicked to button1, to handle Click events:

button1.add_Click(button1_Clicked);  

Then, we define the event handler to pop-up an alert box whenever the button is clicked:

function button1_Clicked(o : Object, e : EventArgs) {
  MessageBox.Show(o.Name());
}  

The package is ButtonClickPkg and the class is ButtonClickCls. We pop up the Windows form by calling the Application.Run() method:

Application.Run(new ButtonClickPkg.ButtonClickCls());

You should get the following Windows form:


Next: How to redefine the OnMouseUp event handler


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Search Engine Optimization: Selecting and Embedding Keywords · Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
IBM DB2 10 for z/OS: Justifying the Upgrade · Living La Vida Colo: Choosing the Right Colocation Facility · FTC Concerns over Social Media Privacy Linger


Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: August 26, 2002
Revised: August 26, 2002

URL: http://www.webreference.com/js/column117/5.html