想将C#代码转换成VB.NET代码,具体代码如下:
发布网友
发布时间:2024-10-08 16:25
我来回答
共1个回答
热心网友
时间:2024-10-08 17:44
你这是声明一个委托吧? 这是我写的一个委托,你参考下,你的代码也不全!有全的,我可以试着帮你看看!
Public Delegate Sub setlist(ByVal ListUsers() As String)
Private Sub ListUsers(ByVal users() As String)
Try
Dim lusers() As String
lusers = users
If lstUsers.InvokeRequired Then
Dim List As setlist = New setlist(AddressOf ListUsers)
Invoke(List, New Object() {users})
Else
Dim I As Integer
For I = 1 To users.Length - 1
lstUsers.Items.Add(users(I))
Next
End If
Catch ex As Exception
MessageBox.Show("异常错误:" & ex.Message, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End Try
End Sub