bmccleary
asked on
VB.NET - Creating a splash screen
I have a project that I would like to have a splash screen display while loading. The main form is called frmMain and the splash screen is called frmSplashScreen. I have the following code, and it works somewhat, but I don't think it's the proper method to use and it doesn't seem to fully close when I close the main form. My project's startup form is frmSplashScreen... what should I do to make a proper splash screen?
Private Sub frmSplashScreen_Paint(ByVa l sender As Object, ByVal e As System.Windows.Forms.Paint EventArgs) Handles MyBase.Paint
Dim i As Double
For i = 0 To 1 Step 0.025
Me.Opacity = i
Me.Refresh()
Next
' Also... how can I pause here for 5 seconds?
Dim MainForm As New frmMain
MainForm.Show()
Me.Hide()
End Sub
Private Sub frmSplashScreen_Paint(ByVa
Dim i As Double
For i = 0 To 1 Step 0.025
Me.Opacity = i
Me.Refresh()
Next
' Also... how can I pause here for 5 seconds?
Dim MainForm As New frmMain
MainForm.Show()
Me.Hide()
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi malharone,
I like your idea interesting concept.
I like your idea interesting concept.
ASKER
Thanks everyone... all those options were great!
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer
For i = 1 To 200
Me.Opacity = i / 200
System.Windows.Forms.Appli cation.DoE vents()
Next
End Sub
Dim i As Integer
For i = 1 To 200
Me.Opacity = i / 200
System.Windows.Forms.Appli
Next
End Sub
Maybe it is just me but does the progressbar really have any meaning or is this just for show? If just for show is there anyway to apply it in a way that is has meaning or represents what is happening in the background?
Tim
Tim
Ive set the following properties for making my form as splash screen
These are
1)FormBorderStyle=None
2)StartScreen=CenterScreen
3)ControlBox=None
4)TopMost=True
Then I pust PictureBox and add a picture and the add few labels and use registry function to fill them..and make it startup page and then I added Windows Timer Control
on and set enabled = true default
then
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Hide()
'Add code to show second form
Timer1.Enabled = False
End Sub
These are
1)FormBorderStyle=None
2)StartScreen=CenterScreen
3)ControlBox=None
4)TopMost=True
Then I pust PictureBox and add a picture and the add few labels and use registry function to fill them..and make it startup page and then I added Windows Timer Control
on and set enabled = true default
then
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Hide()
'Add code to show second form
Timer1.Enabled = False
End Sub
http://www.vb-helper.com/contest_splash_screen.html