Braintique.com header
Left Navigation Bar

Creating Custom Events

This article is part of a multi-article series, C# for Newbies, intended to ease the learning curve and help newcomers get started working productively with C#. It is the second part of a discussion of events. The first part of this Events article discussed events generally in C#, showed how to use the Events tab of the Properties window, and explained the auto-generated code that using the Events tab creates.

The continuation of the Events discussion covers creating custom events. Specifically, how are they fired, and how does your code respond to them.

I find that it’s easiest to understand a process as complex as adding a custom event in the context of an example. The example I’ll use will be an event that is fired if a long integer passed to a method is a prime number. The method will be placed in a class module—although since in .NET a form is just an instance of a class it could also reside in the form class—and the form developed in the first part of this article will both invoke the method that fires the event and respond when the event is fired.

Here are the steps we will need to take to make this work:

Let’s take these steps from the top!

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