开发者

Attaching event handlers in Visual Basic .NET

开发者 https://www.devze.com 2023-03-19 15:12 出处:网络
What’s the equivalent of the C# += operator when used to add event handl开发者_开发知识库ers in VB.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

精彩评论

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