请教有关事件使用的问题
Private Sub wskListener_ConnectionRequest(ByVal sender As _
Winsock_Control.Winsock, ByVal requestID As _
System.Net.Sockets.Socket) _
Handles wskListener.ConnectionRequest
Builds y.UID.ToString for the Winsock Key
Dim x As New Winsock_Control.Winsock
WskCol.Add(x, y.UID.ToString)
AddHandler CType(WskCol.Item(y.UID.ToString), _
Winsock_Control.Winsock).DataArrival, _
AddressOf wsk_DataArrival
End Sub
这是vb.net的一段代码,对于
AddHandler CType(WskCol.Item(y.UID.ToString), _
Winsock_Control.Winsock).DataArrival, _
AddressOf wsk_DataArrival
如果用c#如何实现?谢谢!
------解决方案--------------------最简单的例子:
this.button1.Click += new System.EventHandler(this.button1_Click);
------解决方案--------------------+=
------解决方案--------------------小mm,楼上说的很清楚了
你用c#写的时候就是这样
this.button1.Click += new System.EventHandler(this.button1_Click);
+= 等于 vb.net 中的 AddHandler