Re: How to tell if an event is being consumed?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Samuel R. Neff (blinex_at_newsgroup.nospam)
Date: 12/29/04


Date: Wed, 29 Dec 2004 17:37:46 -0500


You can check if the event is nothing...

Public Event SomeEvent(ByVal sender As Object, ByVal e As EventArgs)

...

If Me.SomeEvent Is Nothing Then
   .. I'm being consumed ..
Else
  .. Not Consumed ..
End If

HTH,

Sam



Relevant Pages

  • Using RaiseEvents
    ... On any form that needs to listen for that event, you create the event handler: ... Public Event OnPageMessageHandler ... RaiseEvent OnChatMessageHandler ... My Question, I think I want to make this a standard event prototype, with sender and EventArgs parameters, for example: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Using RaiseEvents
    ... Publice Event Sub ConnectionDrop ... when they drop the non-ui control to the application form. ... Public Event OnPageMessageHandler ... that your events have a parameter "Sender" As Object and a parameter ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Is the usual Event format the only way to go?
    ... Public Event HeightChanged(ByVal sender As Object, ... Public NotInheritable Class HeightChangeEventArgs ...
    (microsoft.public.dotnet.languages.vb)
  • Re: How to tell if an event is being consumed?
    ... > Public Event SomeEvent(ByVal sender As Object, ByVal e As EventArgs) ... Public Event RowSelected ... the control so that if the form handles the RowSelected event the mouse ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Is the usual Event format the only way to go?
    ... Public Event HeightChanged(ByVal sender As Object, ... Public NotInheritable Class HeightChangeEventArgs ...
    (microsoft.public.dotnet.languages.vb)