Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Make a form refresh itself

Make a form refresh itself

Scheduled Pinned Locked Moved Visual Basic
question
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Code Crapper
    wrote on last edited by
    #1

    I want to make one of my forms refresh itself and all controls in it every few seconds, how would I go about doing this? Thanks in advanced :)

    R 1 Reply Last reply
    0
    • C Code Crapper

      I want to make one of my forms refresh itself and all controls in it every few seconds, how would I go about doing this? Thanks in advanced :)

      R Offline
      R Offline
      Reuven Elliassi
      wrote on last edited by
      #2

      What you need to do is to create a new timer and set the .Interval to the number of few seconds you want multiply by 1000 (ex. 1000 = 1 sec). Timer1.Interval=3000 'will occur every 3 seconds After it you need to Enable the timer: Timer1.Enabled=True In the Timer1_Tick event: ========================= > To update graphic, use Me.Refresh. > To update controls, write the code that does it. Ex: Private Sub Timer1_Tick(...) Me.Refresh ' Refresh the form txtText1.Text = strA ' strA is a string that changed numID.Text = Num3 ' Num3 is an Integer ... End Sub

      C R 2 Replies Last reply
      0
      • R Reuven Elliassi

        What you need to do is to create a new timer and set the .Interval to the number of few seconds you want multiply by 1000 (ex. 1000 = 1 sec). Timer1.Interval=3000 'will occur every 3 seconds After it you need to Enable the timer: Timer1.Enabled=True In the Timer1_Tick event: ========================= > To update graphic, use Me.Refresh. > To update controls, write the code that does it. Ex: Private Sub Timer1_Tick(...) Me.Refresh ' Refresh the form txtText1.Text = strA ' strA is a string that changed numID.Text = Num3 ' Num3 is an Integer ... End Sub

        C Offline
        C Offline
        Code Crapper
        wrote on last edited by
        #3

        Ah thanks for the reply, it works perfecly :cool:

        1 Reply Last reply
        0
        • R Reuven Elliassi

          What you need to do is to create a new timer and set the .Interval to the number of few seconds you want multiply by 1000 (ex. 1000 = 1 sec). Timer1.Interval=3000 'will occur every 3 seconds After it you need to Enable the timer: Timer1.Enabled=True In the Timer1_Tick event: ========================= > To update graphic, use Me.Refresh. > To update controls, write the code that does it. Ex: Private Sub Timer1_Tick(...) Me.Refresh ' Refresh the form txtText1.Text = strA ' strA is a string that changed numID.Text = Num3 ' Num3 is an Integer ... End Sub

          R Offline
          R Offline
          Reuven Elliassi
          wrote on last edited by
          #4

          The code I just added is VB.NET code. In VB6 the parameters are same, but the event called "Timer" instead of "Tick". Private Sub Timer1_Timer Me.Refresh ' Refresh the form txtText1.Text = strA ' strA is a string that changed numID.Text = Num3 ' Num3 is an Integer ... End Sub

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups