Reply: If you want to associate a different Event handler with the same
event use RemoveHandler Statement to disassociate the event with the current
event handler and use the AddHandler statement to associate it with a
different event handler. In my example I used a button control that was used
to start and stop a process. The bulk of the code was in the StopProcess
event:
TextBox1.Text = "Process Complete"
btnStopStart.Text = "Start"
RemoveHandler btnStopStart.Click.AddressOf StopProcess
AddHandler btnStopStart.Click, AddressOf StartProcess
The other code consisted of one line in the Form1 and the StartProcess events.
"Hareth" wrote:
I want to make button1_click do the same as button2_click WITHOUT wrtiting
the exact code all over....
I was thinking of something like (button2 = button1)....obviously that
doesnt work...so....can anyone help???