Hi, Let's create a splash screen using Normal windows Form (like Form1 , form2 ..)
So here when you run the project, first It appears splash screen and wait for 5second, if u user doesn't click "continue", button in 5 seconds, then it navigates to the required page that we mentioned. Got it!!
In order to complete this we need a form named as "splash", a timer and two buttons "btnContinue", "btnCancel".
Now set the Timer's Interval Property to 1000 ( the frequency of elapsed events in Milliseconds).
So now in the form Load event goes like this
Before that i am declaring variable
Private splashCounter As Integer
Private Sub Splash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Timer1.Start() End Sub
Now we have to write code in Timer1's "Tick" event like this.
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick 'Splsh Screen appear for 5 Seconds If splashCounter = 5000 Then Me.Dispose() Else splashCounter += 1000 //every time it gets incremented by 1000, until it reaches 5000 MilliSeconds ( that is 5 seconds) End If End Sub
Now in "btnCanel" click Event
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click Me.Dispose(True) End Sub
Now in "btnContinue" click Me.Dispose() //here write code to show another form or what ever the requirement is
Your input is appreciated.
|
No responses found. Be the first to respond and make money from revenue sharing program.
|