By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,966 Members | 1,230 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,966 IT Pros & Developers. It's quick & easy.

SingleTon Events

P: n/a
I have a singleton class (a music player) then raises events. I originally
dim an instance of this class in my main form using withevents and have event
handlers for the singleton in this main class. Then in another form that I
show on top of the original form, I get an instance of the singleton and also
have event handlers in this form for the singleton's events.

I noted that when the singleton class raises an event, it gets routed to the
event handler in the main form then following that, it is routed to the event
handler in the second form. I pass a current parent object in each event and
check in the event handlers if the parent is that class and exit the handler
immediately if not.

Is this considered acceptable programming or am I going to get into trouble.
I know that instead of using "withevents", I can use Add Handler and Remove
handler to avoid double firing of events but would rather not do it this way.
Dennis in Houston
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.