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. C#
  4. Update The Screen

Update The Screen

Scheduled Pinned Locked Moved C#
questioncsharpcomtutorialannouncement
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.
  • N Offline
    N Offline
    Nick Parker
    wrote on last edited by
    #1

    Does anyone know how to update the screen in C#? For instance, I have a statusbar at the bottom of my form that contains the time inside a panel, how can I force the screen to update and show the current time always? I don't have to use a timer do I? Thanks in advance. Nick Parker

    J 1 Reply Last reply
    0
    • N Nick Parker

      Does anyone know how to update the screen in C#? For instance, I have a statusbar at the bottom of my form that contains the time inside a panel, how can I force the screen to update and show the current time always? I don't have to use a timer do I? Thanks in advance. Nick Parker

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      It appears that a timer will have to be used in that case :( If you want to draw on a Control just call CreateGraphics() on it, but make sure you call Dispose() on it when you are done. James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971

      N 1 Reply Last reply
      0
      • J James T Johnson

        It appears that a timer will have to be used in that case :( If you want to draw on a Control just call CreateGraphics() on it, but make sure you call Dispose() on it when you are done. James Sonork ID: 100.11138 - Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971

        N Offline
        N Offline
        Nick Parker
        wrote on last edited by
        #3

        This may sound like a stupid question but I have always wonder what kind of draw on memory is taken when a timer is constantly used. I am just thinking of times when you are possibly going though a long algorithm while constantly having a timer being used to update the time on the screen. Am I just being ridiculous here or could this be a legitimate concern? Nick Parker

        J 1 Reply Last reply
        0
        • N Nick Parker

          This may sound like a stupid question but I have always wonder what kind of draw on memory is taken when a timer is constantly used. I am just thinking of times when you are possibly going though a long algorithm while constantly having a timer being used to update the time on the screen. Am I just being ridiculous here or could this be a legitimate concern? Nick Parker

          J Offline
          J Offline
          James T Johnson
          wrote on last edited by
          #4

          You shouldn't have to worry about it, the windows timer functionality was designed so it wouldn't bog the system down by itself. If an application has events waiting for it the timer event won't fire. When the system does get to fire the time it will only send one event, not the entire backlog. If you have an excessively long task running it should be placed into a work thread so that the program doesn't appear to be locked up. In that case the main application thread is doing its own thing so it can keep up with event messages sent to it. HTH, James Sonork: Hasaki "I left there in the morning with their God tucked underneath my arm their half-assed smiles and the book of rules. So I asked this God a question and by way of firm reply, He said - I'm not the kind you have to wind up on Sundays." "Wind Up" from Aqualung, Jethro Tull 1971

          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