I'm calling a button click in the form_load like this:
public void Form1_Load(object s, EventArgs e)
{
button.PerformClick();
}
But upon loading the button does not get clicked, what am I doing wrong?
You can write whatever you want to do inside of click in another function and call that from inside the click handler or programmatically like this -
public void Form1_Load(object s, EventArgs e)
{
//button.PerformClick();
PerformClickAction();
}
void button_click(object sender,EventArgs e)
{
PerformClickAction();
}
void PerformClickAction()
{
// Write what you need to do on click
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With