L
lavu
I am trying to start a C# GUI App and automatically trigger a button
click event.
However when I add a statement btn.PerformClick to my Main() I get an
error that a class was expected .
This is what I am trying to do.
static void Main(string[] args)
{
........
Application.Run(new frmMain());
btnTest.PerformClick();
}
and the error is
MyApp.frmMain.btnTest denotes a 'field' where a 'class' was expected.
I do not want to add the code to frmMain() since GUI comes up only
after the button click has already been executed. Waht would be the
best way to do it ?
Any ideas are appreciated.
click event.
However when I add a statement btn.PerformClick to my Main() I get an
error that a class was expected .
This is what I am trying to do.
static void Main(string[] args)
{
........
Application.Run(new frmMain());
btnTest.PerformClick();
}
and the error is
MyApp.frmMain.btnTest denotes a 'field' where a 'class' was expected.
I do not want to add the code to frmMain() since GUI comes up only
after the button click has already been executed. Waht would be the
best way to do it ?
Any ideas are appreciated.