I have a windows application which has 2 forms. Iam trying to achieve this:
When the second form is displayed, I want the first form to be hidden.
I have tried like:
public Executor()
{
InitializeComponent();
Form1.ActiveForm.Hide();
}
But results in "cross-thread operation not valid control accessed from a thread other than the thread it was created on" before getting started the entire application.
How can I achieve what I said? Also in my later code I am trying to close as shown above with the code Form1.ActiveForm.Close();
Any ideas would be really appreciated..