G
Gaz
I am having a bit of a problem getting my application to work
properly.
RIght here is my problem...
WHen my C# windows app loads up the start form, i create a new thread
and show the splash on the new thread and put the main thread to sleep
until the splash screen has done the business, then i kill the new
thread and start another to show the login and again put the main one
to sleep. Problem i have is that my splash screen will show ie has
focus but when my login box appears it is minimised to the taskbar??
and doesnt show up on the screeen like i want it to.
Here is my Code:
//Load the Splash Screen
private void DoSplash()
{
Splash sp = new Splash();
DialogResult Res;
Res = sp.ShowDialog();
if (Res == DialogResult.Abort)
{
KillApp = true;
}
WakeThread = true;
}
//Here is my Login Form
private void ShowLogin()
{
Login lg = new Login();
DialogResult Res;
Res = lg.ShowDialog();
if (Res != DialogResult.OK)
{
KillApp = true;
}
WakeThread = true;
}
and finally my initial form constructor
//Show Splash Screen
Thread th = new Thread(new ThreadStart(DoSplash));
th.Start();
while (WakeThread == false)
{ Thread.Sleep(1000); }
th.Abort();
if (KillApp)
{ KillApplication(); }
//end of splash screen
//Show Login Box
WakeThread = false;
Thread thLogin = new Thread(new ThreadStart(ShowLogin));
thLogin.Start();
while (WakeThread == false)
{ Thread.Sleep(1000); }
thLogin.Abort();
if (KillApp)
{ KillApplication(); }
//end of Login
//GOOD TO GO.....
InitializeComponent();
Can anyone offer a suggestion to what i am doing wrong or if someone
has a better way of doing what im trying to then please let me know
Thanks
properly.
RIght here is my problem...
WHen my C# windows app loads up the start form, i create a new thread
and show the splash on the new thread and put the main thread to sleep
until the splash screen has done the business, then i kill the new
thread and start another to show the login and again put the main one
to sleep. Problem i have is that my splash screen will show ie has
focus but when my login box appears it is minimised to the taskbar??
and doesnt show up on the screeen like i want it to.
Here is my Code:
//Load the Splash Screen
private void DoSplash()
{
Splash sp = new Splash();
DialogResult Res;
Res = sp.ShowDialog();
if (Res == DialogResult.Abort)
{
KillApp = true;
}
WakeThread = true;
}
//Here is my Login Form
private void ShowLogin()
{
Login lg = new Login();
DialogResult Res;
Res = lg.ShowDialog();
if (Res != DialogResult.OK)
{
KillApp = true;
}
WakeThread = true;
}
and finally my initial form constructor
//Show Splash Screen
Thread th = new Thread(new ThreadStart(DoSplash));
th.Start();
while (WakeThread == false)
{ Thread.Sleep(1000); }
th.Abort();
if (KillApp)
{ KillApplication(); }
//end of splash screen
//Show Login Box
WakeThread = false;
Thread thLogin = new Thread(new ThreadStart(ShowLogin));
thLogin.Start();
while (WakeThread == false)
{ Thread.Sleep(1000); }
thLogin.Abort();
if (KillApp)
{ KillApplication(); }
//end of Login
//GOOD TO GO.....
InitializeComponent();
Can anyone offer a suggestion to what i am doing wrong or if someone
has a better way of doing what im trying to then please let me know
Thanks