Y
Young
I create a sub that will add event handlers to text boxes.
The sub declaration look like this:
sub AddGotFocus(myTextBox as TextBox, GotFocusEvent as System.EventHandler)
AddHandler myTextBox.GotFoucs, GotFocusEvent
end sub
I call this sub using AddGotFocus(text1,addressof Gotfocus). This works
without any problem. When I try to do the same for the KeyDown and MouseDown
event, Eg.
sub AddKeyDown(myTextBox as TextBox, KeydownEvent as System.EventHandler)
AddHandler myTextBox.KeyDown, KeydownEvent
I get this error here: Value of type system.eventhandler cannot be
converted to system.windows.forms.keyeventhandler
end sub
sub AddMOuseDown(myTextBox as TextBox, MousedownEvent as
System.EventHandler)
AddHandler myTextBox.Mousedown, MousedownEvent
I get this error here: Value of type system.eventhandler cannot be
converted to system.windows.forms.keyeventhandler
end sub
Can someone please help?
TIA
Young
The sub declaration look like this:
sub AddGotFocus(myTextBox as TextBox, GotFocusEvent as System.EventHandler)
AddHandler myTextBox.GotFoucs, GotFocusEvent
end sub
I call this sub using AddGotFocus(text1,addressof Gotfocus). This works
without any problem. When I try to do the same for the KeyDown and MouseDown
event, Eg.
sub AddKeyDown(myTextBox as TextBox, KeydownEvent as System.EventHandler)
AddHandler myTextBox.KeyDown, KeydownEvent
I get this error here: Value of type system.eventhandler cannot be
converted to system.windows.forms.keyeventhandler
end sub
sub AddMOuseDown(myTextBox as TextBox, MousedownEvent as
System.EventHandler)
AddHandler myTextBox.Mousedown, MousedownEvent
I get this error here: Value of type system.eventhandler cannot be
converted to system.windows.forms.keyeventhandler
end sub
Can someone please help?
TIA
Young