Call button control from public sub

speed

Member
Joined
Apr 4, 2007
Messages
7
Programming Experience
Beginner
I need help on calling button control from public sub.

For example :

Public Sub try()

'WHAT IS THE SYNTAX FOR CALLING Button9 (below) from here...

End Sub


Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click

End Sub

Is it possible? Please help me. Thanks!
 
I've tried the Button9.PerformClick()..the problem is that..say..

Private Sub Button9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click

EditImage()

End Sub


so, if i do the Button9.PerformClick(), the program will automatically considered Button9 to be clicked and call the EditImage().

What I want is that, a method that will call Button9 from Public Sub try(), but it requires the user to click the Button9 manually from the interface before calling the EditImage().

Hope anyone can help me. Thanks in advance!
 
What do you mean by "calling" a button then? just focusing it?
Then use Button9.Focus()

Or is Button9 a control that is supposed to be created at runtime?
 
Last edited:
Back
Top