AddHandler语法 [英] AddHandler syntax
问题描述
您好
在我的代码中,我将状态更改事件的事件处理程序添加到
连接。以下两种语法都工作
AddHandler cnnLibrary.StateChange,New StateChangeEventHandler _
(AddressOf OnStateChange)
AddHandler cnnLibrary.StateChange,AddressOf OnStateChange
我发现代码有或没有任何区别
新StateChangeEventHandler
可以任何人解释这两者之间的区别。
Sub OnStateChange在表单类中被声明为Private
谢谢
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
推荐答案
任何人都可以解释这两者之间的区别。
Can anyone explain the difference between those two.
没有真正的区别,第二个是一个快捷方式,可以节省你打字的价格。
Mattias
-
Mattias Sj?gren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
请回复到新闻组。
There''s no real difference, the second one is a shortcut that saves
you some typing.
Mattias
--
Mattias Sj?gren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
暗示新的。
-
OHM (特里伯恩斯)
。 。 。单手人。 。
如果你需要我的电子邮件,请问我
当你不知道自己在做什么时,过得很快
< us ** @ domain.invalid>在消息中写道
news:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
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
<us**@domain.invalid> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hello
在我的代码中,我将状态更改事件的事件处理程序添加到
连接。以下两种语法都可以工作
AddHandler cnnLibrary.StateChange,New StateChangeEventHandler _
(AddressOf OnStateChange)
AddHandler cnnLibrary.StateChange,AddressOf OnStateChange
我不喜欢找不到代码有没有
新的StateChangeEventHandler
任何人都可以解释这两者之间的区别。
Sub OnStateChange在表单类中声明为Private />
谢谢
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
* us**@domain.inva cover scripsit:
* us**@domain.invalid scripsit:
在我的代码中,我将状态更改事件的事件处理程序添加到
连接。以下两种语法都可以工作
AddHandler cnnLibrary.StateChange,New StateChangeEventHandler _
(AddressOf OnStateChange)
AddHandler cnnLibrary.StateChange,AddressOf OnStateChange
我不喜欢找不到代码有没有
新的StateChangeEventHandler
任何人都可以解释这两者之间的区别。
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.
除了源代码之外没有区别。
-
MS Herfried K. Wagner
MVP< URL: http://dotnet.mvps.org/>
VB< URL:http://dotnet.mvps.org/dotnet/faqs/>
There is no difference except in the source code.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
这篇关于AddHandler语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!