467,923 Members | 1,262 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,923 developers. It's quick & easy.

Raising events ????

Dear all,

I have a class wich is raising events as normally it
should do. having a form in the same assembly wich is
catching those events works fne. Raise events gets catch
normaly within the form and I can process what I want
based on them.

If I try to catch raised events by this class but within a
form located in a different assembly, I am not able to
catch them seems they are not raised or not coming until
the form eventhandler?

any idea why ?

my events are declared as follow in the assembly
Public Event AddCompleted()
Public Event DeleteCompleted()
Public Event UpdateCompleted()
Public Event Accepted()

regards
serge
Jul 21 '05 #1
  • viewed: 1787
Share:
4 Replies
When you are making instances of the class, are you declaring it WithEvents?
"serge calderara" <se*************@maillefer.net> wrote in message
news:0e****************************@phx.gbl...
Dear all,

I have a class wich is raising events as normally it
should do. having a form in the same assembly wich is
catching those events works fne. Raise events gets catch
normaly within the form and I can process what I want
based on them.

If I try to catch raised events by this class but within a
form located in a different assembly, I am not able to
catch them seems they are not raised or not coming until
the form eventhandler?

any idea why ?

my events are declared as follow in the assembly
Public Event AddCompleted()
Public Event DeleteCompleted()
Public Event UpdateCompleted()
Public Event Accepted()

regards
serge

Jul 21 '05 #2
I find our the problem.
sipply declare my event as public shared and they are trigged from
anywhere

regards

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3
Well yes, but that may be more than you need. Shared events (or any shared
members for that matter) do not require an instance of your class to be
used. So imagine being able to wire an event procedure on a class that is
not even instanced.

A good example of this would be the Show method of the MessageBox class.
You don't have to make an instance of a MessageBox to be able to use its
Show method.

If you've solved your problem, great! But you should be able to access
events of a class from a different assembly without having to resort to
this. If the class is declared "WithEvents" then it will receive
notifications about the events that are raised for the base class:

Public WithEvents Button1 As System.Windows.Forms.Button
"calderara serge" <se*************@maillefer.net> wrote in message
news:eA**************@TK2MSFTNGP12.phx.gbl...
I find our the problem.
sipply declare my event as public shared and they are trigged from
anywhere

regards

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 21 '05 #4
Because events get raised through the parent chain... if
your other form isn't in that chain... it will never see
the event get raised.... furthermore, if there is
processing that needs to happen at each level of parent,
you have a different set of issues... to make the event
visible beyond the first parent.......
-----Original Message-----
Dear all,

I have a class wich is raising events as normally it
should do. having a form in the same assembly wich is
catching those events works fne. Raise events gets catch
normaly within the form and I can process what I want
based on them.

If I try to catch raised events by this class but within aform located in a different assembly, I am not able to
catch them seems they are not raised or not coming until
the form eventhandler?

any idea why ?

my events are declared as follow in the assembly
Public Event AddCompleted()
Public Event DeleteCompleted()
Public Event UpdateCompleted()
Public Event Accepted()

regards
serge
.

Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Joe Campbell | last post: by
4 posts views Thread by serge calderara | last post: by
4 posts views Thread by Dave A | last post: by
reply views Thread by Apu Nahasapeemapetilon | last post: by
7 posts views Thread by Christian Cambier | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.