A
Andy Gilman
How can I make the main form of my application appear on top when it is
displayed for the first time. I have a 'splash' / 'loading' screen which
appears while the program is loading and then the main form is displayed.
But if i switch to another app (such as visual studio) then my main form
does not get focus and instead appears as a flashing icon on the taskbar.
I've tried this, to no avail
--------------------------------------------------
private bool isInitialPaint_ = true;
private void MainForm_Paint(object sender,
System.Windows.Forms.PaintEventArgs e) {
if (isInitialPaint_) {
isInitialPaint_ = false;
SplashForm.CloseForm();
this.Activate();
this.BringToFront();
}
}
displayed for the first time. I have a 'splash' / 'loading' screen which
appears while the program is loading and then the main form is displayed.
But if i switch to another app (such as visual studio) then my main form
does not get focus and instead appears as a flashing icon on the taskbar.
I've tried this, to no avail
--------------------------------------------------
private bool isInitialPaint_ = true;
private void MainForm_Paint(object sender,
System.Windows.Forms.PaintEventArgs e) {
if (isInitialPaint_) {
isInitialPaint_ = false;
SplashForm.CloseForm();
this.Activate();
this.BringToFront();
}
}