博客
关于我
VB.NET学习笔记:事件处理及自定义事件
阅读量:257 次
发布时间:2019-03-01

本文共 1175 字,大约阅读时间需要 3 分钟。

VB.NET??????????

1. ??????

?VB.NET????????????????????????????????????????????????????????????????????????? Handles ????

2. ?????????

??????????????????????????????????????????????????????????????????

3. ????????

3.1 ??????

???? Delegate ????????????

Public Delegate Sub CustomEventHandler(ByVal str As String)

3.2 ???????

????????

Public Event CustomEvent As CustomEventHandler

3.3 ??????

??????????????

Public Event CustomEvent(ByVal str As String)

4. ???????

???????????? RaiseEvent ????

RaiseEvent CustomEvent("Hello world")

???????????????

5. ????????

???? Public Sub ????????

Public Sub talk(ByVal str As String)    Me.TextBox1.Text = strEnd Sub

6. ???????

?????? WithEvents ????????????

Public WithEvents Custom As New ClsCustomEvent()

? Load ????????

Custom.RaiseCustomEvent("Hello world")

?????????

Public Sub talk(ByVal str As String) Handles Custom.CustomEvent    Me.TextBox1.Text = strEnd Sub

7. ????????

?? AddHandler ? RemoveHandler ????

AddHandler Custom.CustomEvent, AddressOf talkRemoveHandler Custom.CustomEvent, AddressOf talk

8. ????

  • ????????????
  • ?? WithEvents ????????????????
  • ?? AddHandler ? RemoveHandler ????????????

??????????VB.NET??????????????????

转载地址:http://srjt.baihongyu.com/

你可能感兴趣的文章
PHP:cURL error 60: SSL certificate unable to get local issuer certificate
查看>>
PHP:PDOStatement::bindValue参数类型php5和php7问题
查看>>
Q媒体播放器.如何播放具有多个音频的视频?
查看>>
pickle
查看>>
Pickle thread.lock(Pymongo)
查看>>
pickle模块
查看>>
qYKVEtqdDg
查看>>
pid控制
查看>>
PID控制介绍-ChatGPT4o作答
查看>>
PID控制器数字化
查看>>
Qwen-VL项目使用指南
查看>>
PIESDKDoNet二次开发配置注意事项
查看>>
PIGS POJ 1149 网络流
查看>>
PIL Image对图像进行点乘,加上常数(等像素操作)
查看>>
PIL Image转Pytorch Tensor
查看>>
PIL&QOOT;IOERROR:带有大图像的图像文件被截断(&Q)
查看>>
PIL.Image、cv2的img、bytes相互转换
查看>>
PIL.Image进行图像融合显示(Image.blend)
查看>>
pilicat-dfs 霹雳猫-分布式文件系统
查看>>
Pillow lacks the JPEG 2000 plugin
查看>>