Is it possible to hook up an event to another event in VB8? I have this code in C#...
public event ShowAboutDialog = delegate {};
private void hookupEvents() {
myButton.Click += ShowAboutDialog;
}
And am trying to convert it into VB8, but can't get it to work..
Public Event ShowAboutDialog As EventHandler
Private Sub HookupEvents()
AddHandler AboutMenuItem.Click, AddressOf ShowAboutDialog
End Sub
Thanks!
You just need to pass the name of the event handler routine after AddressOf
Private Sub HookupEvents()
AddHandler AboutMenuItem.Click, AddressOf ShowAboutDialog
End Sub
Public Sub ShowAboutDialog(ByVal sender As Object, ByVal e As System.EventArgs)
End Sub
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With