Lets say I wanna have this function activate everytime any button in a form is clicked. Help me plz
![]()
![]()
![]()
Lets say I wanna have this function activate everytime any button in a form is clicked. Help me plz
![]()
![]()
![]()
assuming you have Button1 and Button 2 defined and you want them to have the same EventHandler
Code:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click, Button1.Click MsgBox("test") End Sub
Hi mga bai, ask ta ko unsa equivalent ani sa C#? Thanks...
hi bro, if your using MS VS 2005 you can press the "thunder" icon on the object property window then double click the
click event ms should make the handler automatically..
something like
or you can do something like..Code:private void button1_Click(object sender, EventArgs e) { // Do your methods }
Code:public void initializeControlstuff() { button1.Click+=new EventHandler(myEventHandler); .... .... } private void myEventHandler(object sender, EventArgs e) { // Do your do you stuff }
Thankz bai..![]()
Similar Threads |
|