Raising an Event

Mark

Member
Joined
Mar 8, 2005
Messages
9
Programming Experience
10+
What I am trying to do is so simple that I have to think I am missing something quite basic. Nevertheless, here goes.... Suppose that there is a command button control (butn1) on a Windows form which simply opens a message box. What would need to be done to add another command button control (butn2) to the form which, when clicked, would do nothing more than raise the click event for butn1.
 
In the click event of butn2 call the click event of butn1:

VB.NET:
butn1_Click(nothing, nothing)

Yeah, it's that simple. As long as you are not using the event args or the sender objects inside of the butn1 click event, that will work. If you are, then it does get more complicated.

Tg
 
Back
Top