I am creating a splash screen. After a second i want to put text on it. After another second add some more. Anyone know how to do this?
Printable View
I am creating a splash screen. After a second i want to put text on it. After another second add some more. Anyone know how to do this?
Use a Timer. :D
I think an interval of 1000 is the same as one second.
Yes i use a timer, but i can't figure out the IF statement to use.
Since i have no idea what you're doing exactly, i'll give you a general (ie: Basic) idea. You can reformulate as needed.
This code is for inside the Timer:
Above code relies on the fact you have declared this globally: dim iWhatPass as integer =0VB Code:
IF iWhatPass = 1 then lblText1.text = "first time around" elseif iWhatPass = 2 then lblText2.text = "2nd time" elseif iWhatPass = 3 then lblText3.text = "third pass" Timer1.interval = 0 end if iWhatPass +=1
hello, I'm wondering how to get a splash screen ? Can anyone tell me? I looking for this object for long time.
A splash screen isn't something you purchase at a gas station..:D
You simply create your splash screens using the classes within the FCL (framework class library).
cant you just use a borderless form? (essentially thats all a splashscreen was in VB6)
btw rafiki47 ...I like your av :) I created that one 2+ years ago!
ok..it works...
but..heres a few tips:
to load Form1
Dim frm as New Form1 'or whatever your next form will be
frm.Show
You cant close the splashscreen form w/o closing all forms (since the following forms are "owned" by the splashscreen)
so.. me.Close() will close all...
so in the next form...(or the "exit" call)
Application.Exit seems to work
I called it in the Form1_Closing sub...
OK.
So lets see if we can work through this. I created a startup module. here is the code in it.
Public Sub Main()
' Create new splash/Main Forms
Dim frmNewSplash As New frmSplash()
Dim frmNewMain As New frmMain()
' SHOW Splash Screen
frmNewSplash.ShowDialog()
'Now show main form
frmNewMain.ShowDialog()
End Sub
----------------------------------------------------------------------------------
Here is the code in the splash screen for the Tick event.
Private Sub tmrSplash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSplash.Tick
Me.Close()
End Sub
-----------------------------------------------------------------------------------
Here is an Example of what i am doing.....
Private Sub frmSplash_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim graCurrent As Graphics = e.Graphics
Dim recCurrent As Rectangle, colCurrent As Color
Dim sbCurrent As SolidBrush, penCurrent As Pen
' Create a rectangle the same size as the form and color it white
recCurrent = New Rectangle(0, 0, Me.Width, Me.Height)
sbCurrent = New SolidBrush(Color.White)
graCurrent.FillRectangle(sbCurrent, recCurrent)
End Sub
---------------------------------------------------------------------------------
Now what i am trying to accomplish .
The tick event is set in the properties to 5 seconds. At one second i would like to draw a line. At two seconds do something else. And so on. Could anyone help?
Thanks
Lethal, Mobile is going to begin giving away splash screens with a purchase of 10 gallons or more...
Sweet! ;)
Thanks,
The posts are very helpful.
Anyone?
Simple version of what your asking
Timer interval is set to 1000 (1 sec)
VB Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Static x As Integer If x = 1 Then Label1.Text = "Loading." End If If x = 2 Then Label1.Text = "Loading.." End If If x = 3 Then Label1.Text = "Loading..." End If If x = 4 Then Label1.Text = "Loading...Form1" End If If x = 5 Then Dim frm As New Form1 frmSplash.ActiveForm.Hide() frm.Show() End If x += 1 End Sub