how to distinguish which method within a button call?

yuhong

Member
Licensed User
Longtime User
There are 2 buttons call the same as a method , how to distinguish which method within a button call?

Sub EditMode()
Dim btnOK As Button
btnOK.Initialize("RunFunc")
btnOK.Text="确定"
btnOK.BringToFront
panel1.AddView(btnOK,10,40,50,60)

Dim btnCancel As Button
btnCancel.Initialize("RunFunc")
btnCancel.Text="取消"
btnCancel.BringToFront
panel1.AddView(btnCancel,10,100,50,60)

End Sub


Sub RunFunc_Click
Label1.Text="OK"
'How known which button click?:sign0085:
End Sub
 

JonPM

Well-Known Member
Licensed User
Longtime User
Use Sender, and either give each button a different tag or go off the text

Sent from my DROIDX
 
Upvote 0
Top