We help IT Professionals succeed at work.

Synatx of this sub procedure

Frank Freese
Frank Freese asked
on
Experts,
Some of this code I have posted I understand. But could someone explain to me:
"sender As System.Object"
"ByVal e As System.EventArgs"
"Handles"
in English, please.
 Private Sub btnReplace_Click(ByVal sender 
As System.Object, ByVal e As System.EventArgs) Handles btnReplace.Click

Open in new window

Comment
Watch Question

Most Valuable Expert 2012
Top Expert 2014
Commented:
sender is the control which caused the event (btnReplace in this case). Its of type object (generic) so that any control can be a sender. e is the event arguments. e is empty in this case but it carries the event specific information in other events such as the key character in keypress event or mouse coordinates in mouse related events. Handles clause links this event handler to a specific event of a specific control. So this event will be executed whenever the btnReplace is clicked.

Author

Commented:
thanks

Author

Commented:
thank you
Most Valuable Expert 2012
Top Expert 2014

Commented:
Glad to help :-)