|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to capture events fired from objects in collectionusing 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!!! -- moondaddy@nospam.nospam
Show quote
Hide quote
"moondaddy" <moondaddy@nospam.nospam> schrieb: Take a look at 'RaiseEvent' and 'AddHandler'/'RemoveHandler' in the >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? documentation. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Thanks. I made a sample project with the code that passes the event through
the colletion to the top level object for anyone who's interested. -- Show quoteHide quotemoondaddy@nospam.nospam "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message [attached file: 2005-04-13_Collection_WithEvents.zip]news:ePy1vWFQFHA.2972@TK2MSFTNGP14.phx.gbl... > "moondaddy" <moondaddy@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/> >
Listview size
Enumerator vs ForNext vs ForEach Working between forms Is there anyway to tell when code is executing at compile time? Exception handling problem Retrieving Child Rows currentDomain.UnhandledException Async Delegate question FileSystemWatcher - setup a sequence of calls (one file after another)? animation in menubar like in IE |
|||||||||||||||||||||||