开发者

Attaching event handlers in Visual Basic .NET

What’s the equivalent of the C# += operator when used to add event handl开发者_开发知识库ers in VB.NET?

TreeView1.TreeNodeDataBound += new TreeNodeEventHandler(TreeView1_TreeNodeDataBound);


Something like:

AddHandler TreeView1.TreeNodeDataBound, AddressOf TreeView1_TreeNodeDataBound


First define a method with the same signature as the event and use the AddHandler Statement to tie the event with the method.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜