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

raise events from a nested class

P: n/a
Hello, somebody know how to raise an event from a nested class?

I have two classes, the class1 with 1 events, and a
nested class (class2) inside the class1. So... How can I raise class1 events
from the class2?

Public Class class1
Public Shared Event Evento1(ByRef sender As Object)

Public Class class2
Public Sub Pippo()
RaiseEvents MioEvento 'error !!!!!!
End Sub
End Class
End Class
Thanks a lot!!
Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
if i remember well, you must to use a delegate.... but may be im wrong...
--
Salute by the First Time!
"Pietro" wrote:
Hello, somebody know how to raise an event from a nested class?

I have two classes, the class1 with 1 events, and a
nested class (class2) inside the class1. So... How can I raise class1 events
from the class2?

Public Class class1
Public Shared Event Evento1(ByRef sender As Object)

Public Class class2
Public Sub Pippo()
RaiseEvents MioEvento 'error !!!!!!
End Sub
End Class
End Class
Thanks a lot!!

Nov 21 '05 #2

P: n/a
Add an event and raise it in Class 2 then in the Class 1 handler for the
Class 2 event, raise the Class 1 Event. Of course, in Class 1, you must
declare Class2 WithEvents.
--
Dennis in Houston
"Rothariger" wrote:
if i remember well, you must to use a delegate.... but may be im wrong...
--
Salute by the First Time!
"Pietro" wrote:
Hello, somebody know how to raise an event from a nested class?

I have two classes, the class1 with 1 events, and a
nested class (class2) inside the class1. So... How can I raise class1 events
from the class2?

Public Class class1
Public Shared Event Evento1(ByRef sender As Object)

Public Class class2
Public Sub Pippo()
RaiseEvents MioEvento 'error !!!!!!
End Sub
End Class
End Class
Thanks a lot!!

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.