如何在VB.NET中添加事件处理程序? [英] How to add an event handler in VB.NET?

查看:59
本文介绍了如何在VB.NET中添加事件处理程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码是 AjaxControlToolkitSampleSite 的一部分.确切地说,它在 AsyncFileUpload 控件中:

This code is part of AjaxControlToolkitSampleSite. To be exact, it is in the AsyncFileUpload control:

 AsyncFileUpload1.UploadedComplete += new EventHandler<AsyncFileUploadEventArgs>(AsyncFileUpload1_UploadedComplete);

如何将其翻译为VB.NET?

How can I translate this to VB.NET?

推荐答案

在这里:

AddHandler AsyncFileUpload1.UploadedComplete, AddressOf AsyncFileUpload1_UploadedComplete

或者,在您的代码中,您可以从左侧的下拉列表(位于代码上方)中选择 AsyncFileUpload1 控件,然后从右侧下拉列表.

Alternatively, within your code, you can select the AsyncFileUpload1 control from the left-hand dropdown list (just above the code) and then select the UploadComplete event from the right-hand dropdown list.

这将使用VB Handles 声明自动创建具有正确签名的事件处理程序.

This will automatically create an event handler with the correct signature using the VB Handles declaration.

这篇关于如何在VB.NET中添加事件处理程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆