show form once?

crystaluz

Well-known member
Joined
Feb 17, 2009
Messages
55
Programming Experience
Beginner
I have a codes like this in timer of Form1 :

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim proceed As New Form2

proceed.Show()

End Sub

The problem is...the Form2 were continuosly shown. I just want to show the Form1 just once. Anyone can help me?
 
There is coding that you can use to search and see if the form is already open or not (which I can provide) but I have to wonder why would there ever be a need to open a form in a timer which is fired multiple times.... Again I can provide the coding but would first suggest taking a look to see if this could be structured better and if not at least setting something to turn your timer off once the form is opened the first time.
 
Add a Timer1.Enable = false after you show the form? It will stop the timer from "ticking" after the form is shown and make it show your form only once but yeah, as Tom said it doesn't make a lot of sense.
 
Back
Top