VB Event ClientCountChanged As CbDelegate(Of Integer)是事件,不能调用,请使用RaiseEvent引发事件

fqcotory 2020-06-04 11:57:24
这段代码是C#的,现在给他改为VB.NET,报错:
Event ClientCountChanged As CbDelegate(Of Integer)是事件,不能直接调用,请使用RaiseEvent引发事件,这个怎么改为VB?
C#代码:
private ITcpServerEngine tcpServerEngine;

this.tcpServerEngine.ClientCountChanged += new CbDelegate<int>(tcpServerEngine_ClientCountChanged);这儿改为:Me.tcpServerEngine.ClientCountChanged += New CbDelegate(Of Integer)(AddressOf tcpServerEngine_ClientCountChanged)报错

void tcpServerEngine_ClientCountChanged(int count)
{
this.ShowConnectionCount(count);
}

这个应该怎么改为VB.NET呢?
...全文
1147 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
AddHandler tcpServerEngine.ClientCountChanged , AddressOf tcpServerEngine_ClientCountChanged
qq_22313195 2020-12-22
  • 打赏
  • 举报
回复
怎么搞定的?
fqcotory 2020-06-04
  • 打赏
  • 举报
回复
还是自己搞定

16,722

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧