473,471 Members | 1,695 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to capture events fired from objects in collection

I have a class (myClass) that used to reference a business class (myObj)
using With Events so when myObj raised the event TestEvent, myClass received
it like this

Private Sub myObj_TestEvent (ByVal someVal As String) Handles
myObj.TestEvent

End Sub

Now I created a bindable list class (oList) which contains a collection of
myObj and myClass now reverences oList instead of myObj.

oList Imports System.ComponentModel, Inherits CollectionBase and Implements
IBindingList.

How can I raise the event TestEvent in myObj and receive it in myClass via
oList?

Thanks!!!
--
mo*******@nospam.nospam
Nov 21 '05 #1
1 1665
"moondaddy" <mo*******@nospam.nospam> schrieb:
I have a class (myClass) that used to reference a business class (myObj)
using With Events so when myObj raised the event TestEvent, myClass
received it like this

Private Sub myObj_TestEvent (ByVal someVal As String) Handles
myObj.TestEvent

End Sub

Now I created a bindable list class (oList) which contains a collection of
myObj and myClass now reverences oList instead of myObj.

oList Imports System.ComponentModel, Inherits CollectionBase and
Implements IBindingList.

How can I raise the event TestEvent in myObj and receive it in myClass via
oList?

Take a look at 'RaiseEvent' and 'AddHandler'/'RemoveHandler' in the
documentation.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

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

Similar topics

2
by: aimee | last post by:
Hi. Is there a way to capture the events fired in a PrintDialog? I would like to capture when the user presses "Print" so I can do some cleanup. The asp.net (IE6) application I'm working on has 6...
15
by: Rhy Mednick | last post by:
I have a class (let's call it ClassA) that I've written which has events. In another class (let's call it ClassB) I create a collection of ClassA objects. In a third class (ClassC) I create a...
0
by: Oddball | last post by:
Is there any way to capture the graphics output of a control and route it to another control? That's confusing.. It's all about my listbox again - I want to be able to draw an image of a user...
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
4
by: Dave A | last post by:
I am developing a somewhat complex component at the moment and coincidently I am also reading the Framework Design Guidelines book. After reading the section about event raising I have re-written...
7
by: AndrewMBaldwin | last post by:
I have a grid control (inherits from Placeholder) that has a few buttons on it. On this grid there is a filter form, which allows the user to filter/search the table for specific information. My...
7
by: nick.fletcher | last post by:
I have a custom collection which derives from Collection<which stores a number of objects. Before each item is added to the collection - an event which it exposes is hooked by the collection and...
3
by: Daniel | last post by:
Hi, I have a scenario where a class is wrapped inside another but the inner class triggers an event. I want that event to be accessed outside of the wrapper. As a result i do code such as: ...
5
by: =?Utf-8?B?VmFubmk=?= | last post by:
Hi, I have a component where I need to have thread-safe access to a list. Operations on the list are done in critical sections (lock (lockObject) { ... } ) in the usual way, to make sure that no...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
1
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...
0
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...
0
muto222
php
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.