In this post we will discuss about how we can call a button click from another button click in C#.Net. Remember this is available in windows application not in web application.
You can also check my previous posts on Encrypt and Decrypt a file in C#.Net, What is Automation Testing? and Add property to class in C#.Net.
It is easy to call a button click on another button click. Check the full code below:
public partial class Form1 : Form
private void btnFirst_Click(object sender, EventArgs e)
lblResult.Text = “This is the First Button!”;
private void btnSecond_Click(object sender, EventArgs e)
Here in the second button click event we are calling the first button click and the result will be shown as “This is the First Button!”. Check the figure for output.