AddHandler syntax

  • Thread starter Thread starter One Handed Man \( OHM - Terry Burns \)
  • Start date Start date
O

One Handed Man \( OHM - Terry Burns \)

New is implied.

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing
 
* (e-mail address removed) scripsit:
In my code I add an event Handler for the state change event to a
connection. Both syntaxes below work

AddHandler cnnLibrary.StateChange, New StateChangeEventHandler _
(AddressOf OnStateChange)
AddHandler cnnLibrary.StateChange, AddressOf OnStateChange

I don't find any difference between the code with or without
New StateChangeEventHandler

Can anyone explain the difference between those two.

There is no difference except in the source code.
 
Hello

In my code I add an event Handler for the state change event to a
connection. Both syntaxes below work

AddHandler cnnLibrary.StateChange, New StateChangeEventHandler _
(AddressOf OnStateChange)
AddHandler cnnLibrary.StateChange, AddressOf OnStateChange

I don't find any difference between the code with or without
New StateChangeEventHandler

Can anyone explain the difference between those two.
The Sub OnStateChange is declared Private in the form class

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top