Braintique.com header
Left Navigation Bar

Notifying the Firing Class

Next, let’s add a notification to the instance of the class module so that the code placed in the event handler is processed when the event is fired. As a preliminary to doing this, we’ll need to create an instance of Class1 in the form class. I’m going to create a Button named btnDoPrimeThing, with the intention of placing the code to be executed in the Button’s click event, and displaying the rests in a multi-line Textbox.

Here’s the code in the click event that creates an instance of Class1 and tells the event in the class to notify the event handler in the form class when it is fired:

private void btnDoPrimeThing_Click(object sender, System.EventArgs e) {
Class1 class1 = new Class1();
class1.OnPrime += new Class1.OnPrimeEventHandler
(this.Class1_OnPrime);
}

Previous Table of Contents Next


Google
 
Web www.braintique.com
www.digitalfieldguide.com www.googleplexblog.com


Home | Barticles | Blogs | Books | Services | FAQ | Contact

© Braintique.com. All rights reserved.

Search Engine Optimization







RSS 2.0 Syndication feed

Syndication Viewer

Our Web host:
IX WebHosting



Food for Your Brain! Get a Barticle! Questions Answered Books for You What We Can Do For You Contact Us Brain Food Questions Answered Books for You What We Can Do For You Frequently Asked Questions About Us Google Research Photoshop Wi-Fi and Wireless Networking The Natural Way to Write