473,521 Members | 2,880 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handling events from an array of objects

Dan
I want to declare an array which contains multiple instances of an object
which raises an event. I then want to define a single event handler which
handles the events which each instance in the array raises. Can somebody
point me to some code which does something like that?

Thanks...

Dan
Nov 23 '05 #1
2 1087
See the AddHandler / RemoveHandler statements in the help.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Dan" <Da*@discussions.microsoft.com> escribió en el mensaje
news:FD**********************************@microsof t.com...
I want to declare an array which contains multiple instances of an object
which raises an event. I then want to define a single event handler which
handles the events which each instance in the array raises. Can somebody
point me to some code which does something like that?

Thanks...

Dan

Nov 23 '05 #2
Dan
Thanks very much!

"Carlos J. Quintero [VB MVP]" wrote:
See the AddHandler / RemoveHandler statements in the help.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Dan" <Da*@discussions.microsoft.com> escribió en el mensaje
news:FD**********************************@microsof t.com...
I want to declare an array which contains multiple instances of an object
which raises an event. I then want to define a single event handler which
handles the events which each instance in the array raises. Can somebody
point me to some code which does something like that?

Thanks...

Dan


Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1789
by: Russell E. Owen | last post by:
I'm writing a C extension for numarray and am puzzled about the idiom for error handling. The documentation seems to say one should always decref an array after calling NA_InputArray, etc., to convert numarray args to C arrays. However, the example and also the numarray code suggests that it's OK to return early via (for example)...
2
3004
by: Steve Jorgensen | last post by:
When writing VB or VBA code that works with databases or other external libraries that cannot be trusted to automatically do the right thing when references to their objects are arbitrarily released, some thought must be put into how to make sure the objects will all be closed and released in the correct order, even in the result of an error....
0
1406
by: Efim | last post by:
Hi, I have got some problem with sending of events in .NET. I am using remouting. The client has got 2 objects for receiving different types of events (responses and events) The server has got two objects for sending of these events. The client opens tcp port 0 to receive events: if (ChannelServices.GetChannel("tcp") == null) {
4
1735
by: hillcountry74 | last post by:
Hi, I'm a newbie and trying to understand event handling in c#. I have understood handling events using delelgate objects. But not this method- "Event handling by overriding the virtual protected method of the base class". Can someone please explain this with a sample code? Thanks a lot.
2
1928
by: Wavemaker | last post by:
The canonical way of declaring delegates for events is to include a parameter representing the sender as well as an EventArgs derived class (or EventArgs itself) as the second parameter representing the data that accompanies the event. For example: public delegate void MessageReceivedHandler(object sender, MessageReceivedArgs e); // ...
12
2769
by: scsharma | last post by:
Hi, I am working on creating a webapplication and my design calls for creating main webform which will have menu bar on left hand side and a IFrame which will contain all the forms that are shown when menu items are clicked.Besides these i would like to put a custom status bar. Any error message encountered in any of the webpage will be...
7
1804
by: Jay Douglas | last post by:
Greetings, I have a Windows form application that (naturally) instantiates all sorts of objects. I have a base object that contains an event. Lots of other objects inherit from this event. When the base object or any derived object is instantiated I would like to automagically start listening for the event. An example and a further...
132
5468
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid hard-to-find bugs. http://distributed-software.blogspot.com/2007/01/c-exception-handling-is-defective.html Regards, zorabi@ZHMicro.com...
0
7326
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7245
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7471
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
5771
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4810
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3298
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1689
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
862
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.