Results 1 to 2 of 2

Thread: showing/hiding multiple picboxes in one timer

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2004
    Posts
    23

    showing/hiding multiple picboxes in one timer

    i'm making a game project for VB.NET class and i really need to know how to put multiple picboxes into one timer. Like show them then hide them. without using 10000000 timersex how do u combine these 2 timers into 1
    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
    picMove2.Left = picMove1.Left + x
    picMove1.Left = picMove2.Left + x
    picMove1.Hide()
    picMove2.Show()

    Timer2.Enabled = False
    Timer3.Enabled = True
    End Sub

    Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
    picMove3.Left = picMove2.Left + x
    picMove1.Left = picMove3.Left + x
    picMove2.Hide()
    picMove3.Show()

    Timer3.Enabled = False
    Timer4.Enabled = True


    End Sub

    plz help thx

  2. #2
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    Instead of timers, maybe you should have one or just a few, but then use events to trigger other action, or call a method that will determine what to do. You could also have threads that continuously check the state of a variable (like dirty or picMove2.visible) and that would take action or call a method if the state changes.

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