473,387 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

raise events from a nested class

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
2 2057
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: askingBoy | last post by:
Hello , I would like to know how to make this : I have a library written in Visual Basic .Net that has some events for its class , I am making an instance of this class in a Visual basic 6.0...
1
by: Dan Cimpoiesu | last post by:
I have a remoting object, derived from MarshalByRefComponent, that I instantiate on the client side, with Activator.GetObject. Can I receive events fired on the server, on the client? How?
1
by: AA | last post by:
Hello, somebody know how to raise an event from a nested class?? This is my situation... I have two classes, the class1 with 2 events, and a nested class (class2) inside the class1. So... How can...
2
by: Andrew | last post by:
Hi, friends, I need to raise certain events in my VC# windows control library. Any reference paper or sample source code for help? Thanks a lot...
4
by: Jeremy | last post by:
I have a combobox with a SelectionChangeCommitted event handler, and am having a problem raising this event. For example, raiseEvent mycombobox.SelectionChangeCommitted gives me an error...
1
by: Rethish R | last post by:
Hi, I have defined few Events in VB.Net, Register the DLL using "Register Interop for COM" Option. Now I have referred the class in VB 6.0. That is add the referrence for the DLL. But I am not...
3
by: Carmella | last post by:
Is it possible for a class to create an instance of a private nested class which raises events and then listen for those events? In the example below, when InnerClass sings, OuterClass should say...
1
by: Anonieko | last post by:
I know Visual Studio lacked support on easily writing code to raise events from a ascx user control ( because you have to hand write them)....
11
by: nadeem_far | last post by:
Hello, I am working on a c# project using framework 1.1. Since its a console application,no windows forms are being used. I am trying to implement event driven classes that just want to raise...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.