Link to home
Start Free TrialLog in
Avatar of bakerOSU333
bakerOSU333

asked on

Why won't PerformClick() work?

I'm trying to call a form and have it automatically click a button, but for some reason PerformClick won't work...  I've attached the form's code below.
public partial class frmTempDet : Form
    {
        public frmTempDet(string monthYear, string cycle)
        {
            InitializeComponent();
            txtMonthYear.Text = monthYear;
            cbCycle.Text = cycle;
            btnTempDet.PerformClick();
        }
 
        private void btnTempDet_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Success");
        }
    }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of p_davis
p_davis

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial