Hello,
I try to program an event handler for a mouse drag and drop. I have the following c# code and I want to translate it to vb.net.
c#:
ListBox1.MouseDown += New MouseEventHandler(ListBox_MouseDown)
private void ListBox_MouseDown(object sender, MouseEventArgs e)
{
}
vb.net:
Dim MouseDown As New MouseEventHandler(AddressOf Listbox_MouseDown)
Private Sub ListBox_MouseDown(ByVal sender As System.Object, ByVal e As MouseEventArgs)
...
End Sub
The failure is in the AddressOf statement, but Listbox_MouseDown is correct, or not??
I try to program an event handler for a mouse drag and drop. I have the following c# code and I want to translate it to vb.net.
c#:
ListBox1.MouseDown += New MouseEventHandler(ListBox_MouseDown)
private void ListBox_MouseDown(object sender, MouseEventArgs e)
{
}
vb.net:
Dim MouseDown As New MouseEventHandler(AddressOf Listbox_MouseDown)
Private Sub ListBox_MouseDown(ByVal sender As System.Object, ByVal e As MouseEventArgs)
...
End Sub
The failure is in the AddressOf statement, but Listbox_MouseDown is correct, or not??