Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI DEARS.
i have button1 & button2 in my form, i want if user clicked button1,button2 be clicked.
Posted
Comments
bopannavb 20-Nov-12 2:42am    
you want to execute the code written in button 2 click on button 1 click or just the button 2 should be selected

C#
void Button2_Click(object sender, EventArgs e)
        {
            Button1.PerformClick();
        }
 
Share this answer
 
Place the following code in button1 click event.
This will call the button2's button click event handler programatically..


C#
button2.PerfomClick();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900