Results 1 to 3 of 3

Thread: Windows Form Loop

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2010
    Posts
    16

    Windows Form Loop

    Hello people

    I need to your help to create somthing simple for testing.
    I want to have a form1 with a button,button1 and when i press the button to
    open a new form (form2) and display it for 5 mins.Then automatically to display my third form (form3) for 5 min and then loop again.Could you help me on this becuase i a new to vb?
    thanks

  2. #2
    Fanatic Member
    Join Date
    Dec 2009
    Posts
    547

    Re: Windows Form Loop

    Probably a terrible way of doing it, I'm sure one of the more experienced members will correct me if im doing it badly. Also and this is of course keeping in mind that form1 will always be visible. (can easily be changed to only have one form showing)

    Add 1 button, 2 timers 3 forms,

    add all controls to form 1, all you got to do is play with the interval of the timers in properties

    Code:
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Timer1.Enabled = True
        End Sub
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            Form3.Close()
            Form2.Show()
            Timer1.Enabled = False
            Timer2.enabled = True
        End Sub
    
        Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
            Form2.Close()
            Form3.Show()
            Timer2.Enabled = False
            Timer1.Enabled = True
        End Sub

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2010
    Posts
    16

    Re: Windows Form Loop

    hello kayleigh and thanks for reply

    while i am trying your code i see that its not easy to change the timer interval time to make the form2 show for 5 min and then the form3 for 5 min and loop again.i try to change the interval time to 5 min but then when i press the button it also takes a 5min for the form2 to load.What you suggest in this?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width