List Info

Thread: Raise events




Raise events
user name
2006-04-01 14:11:45
> I've got a collection of DataGridView's, these are
displayed on a tab
> control.
> When I select a row in one of the DataGridView, I need
to raise an event,
> but that means the event will be triggered inside the
collection ??
>
> How does the event bubble to the main from from the
collection ?
> or am I barking up the wrong tree !!??!?

It sounds like you want to raise events when something
happens to the the
objects within the collection rather than when objects are
added and removed
from the collection.

I thnk you can have the collection's Add method use
AddHandler to assign an
event handler to the new object.

Similarly you can use RemoveHandler to remove the event
handler when an
object is removed from the collection so the collection
doesn't continue to
fire events for an object that isn't in it any more.

Rod

Rod Stephens, Author of "Visual Basic 2005
Programmer's Reference"
http://www.v
b-helper.com/vb_prog_ref.htm

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )