Posted by: Sourav | June 12, 2015

Close the form after couple of seconds VB.Net


I have form2 which calls form3 and exits(form2)

My form3 will remain visible for 20 seconds

I have timer1 on form3

so

My form2 class form3 ,so in form2  wrote

Form3.Timer1.Interval = 2000
Form3.Show()

Public Class Form3
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

‘Initiate Timer
Timer1.Start()
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Me.Close()
End Sub
End Class

Source

http://stackoverflow.com/questions/4506033/close-form-after-10-seconds

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: