How to handle form loading in sequence?

L

ltnats

Hi there,
I have C# Windows Forms app I am building that has a Splash Screen
and 4 other forms that are to be shown in different sequences depending
on what sequence buttons on the forms are pressed.

I had written a starter class to handle this. The starter class used
ShowDialogue() to open the forms. Each form had a public property
called FormAction that I set with information as to what form to open
next. So when I set the Forms DialogueResult = OK and return the
point of execution to the starter class I could get the FormAction
property and see what form to open next.

But there is no MainForm as such. So I never used Applicaiton.Run()
anywhere, just ShowDialogue() and Dispose(). When I try to the program
just stops at that point and won't go any further. I am getting some
display problems on some of my forms and I have read that it can be due
to NOT using Application.Run().

How can I use Application.Run() if I have no main form?

Thank you for your time,

Scott.
 
D

D. Yates

Why not just have a main form and hide it?

private void Form1_Load(object sender, System.EventArgs e)
{
this.Visible = false; // Hides it from alt tab
this.ShowInTaskbar = false;
this.WindowState = FormWindowState.Minimized;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top