Application.Run(form);
Actually I tried to call this from my project. I got this exception. How to solve it? I have already called another Application.Run(frmBind); in my project.
Starting a second message loop on a single thread is not a valid
operation. Use Form.ShowDialog instead.
static void Main(string[] args)
{
frmBind = new frmMain();
Application.Run(frmBind);
//args1 = string.Copy(args);
}
This is where I call the Application at first
Now again did it here:
try
{
// Application.Run( form);
form.ShowDialog();
}
Here the exception is thrown.
It’s telling you how to solve it:
or if you want the new form to be modal: