TipGiver
Programmer
- Sep 1, 2005
- 1,863
This is the form i want to show as dialog.
NOTE: The above code is in the SplashForm form.
When the SplashForm is Shown then i do a 5sec delay and show the mainform. The SplashForm in the Constructor takes a boolean isSplash (it is both splash and about form).
When the isSplash is true (act like "Splash" Form), everything is ok. When it is false (act like "About" Form), the code in the IF is skipped (because the MainForm is already shown), the SplashForm's .ShowDialog acts like dialog (owner (MainForm) does not have focus), but the SplashForm dont show.
Any ideas?
Code:
Private Sub SplashForm_Shown(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Shown
Application.DoEvents()
If (Me.isSplash = True) Then
Dim mf As New Global.Dialogs.MainForm
Dim [stop] As DateTime = DateTime.Now.AddSeconds(5)
Me.Timer1.Enabled = True
While ([stop] > DateTime.Now)
Application.DoEvents()
End While
mf.Show()
Me.Dispose(False)
End If
End Sub
NOTE: The above code is in the SplashForm form.
When the SplashForm is Shown then i do a 5sec delay and show the mainform. The SplashForm in the Constructor takes a boolean isSplash (it is both splash and about form).
When the isSplash is true (act like "Splash" Form), everything is ok. When it is false (act like "About" Form), the code in the IF is skipped (because the MainForm is already shown), the SplashForm's .ShowDialog acts like dialog (owner (MainForm) does not have focus), but the SplashForm dont show.
Any ideas?