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. Text in form title bar not keeping up (me.text)

Text in form title bar not keeping up (me.text)

Scheduled Pinned Locked Moved Visual Basic
helpquestion
5 Posts 3 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.
  • J Offline
    J Offline
    Johan Hakkesteegt
    wrote on last edited by
    #1

    Hi, I have an app that retrieves and calculates a lot of data. The whole process may take about 20 minutes. To prevent the user from thinking that the app has crashed, I added a progress bar, and to give the user a better idea of the progress, I make the form's title bar display a percentage. The problem is that at pretty much any percentage the form no longer updates itself. The application keeps running, no problem, but the progress bar and percentage in the title bar get stuck, which effectively defeats the purpose. Can anyone tell me why this may happen ? Cheers, Johan

    My advice is free, and you may get what you paid for.

    C 1 Reply Last reply
    0
    • J Johan Hakkesteegt

      Hi, I have an app that retrieves and calculates a lot of data. The whole process may take about 20 minutes. To prevent the user from thinking that the app has crashed, I added a progress bar, and to give the user a better idea of the progress, I make the form's title bar display a percentage. The problem is that at pretty much any percentage the form no longer updates itself. The application keeps running, no problem, but the progress bar and percentage in the title bar get stuck, which effectively defeats the purpose. Can anyone tell me why this may happen ? Cheers, Johan

      My advice is free, and you may get what you paid for.

      C Offline
      C Offline
      ChandraRam
      wrote on last edited by
      #2

      Johan Hakkesteegt wrote:

      I have an app that retrieves and calculates a lot of data. The whole process may take about 20 minutes. To prevent the user from thinking that the app has crashed, I added a progress bar, and to give the user a better idea of the progress, I make the form's title bar display a percentage. The problem is that at pretty much any percentage the form no longer updates itself. The application keeps running, no problem, but the progress bar and percentage in the title bar get stuck, which effectively defeats the purpose. Can anyone tell me why this may happen ?

      The UI will not respond so long as there are other things to do... looks like all this is in the same thread, maybe you can do your process in a separate thread?

      J 1 Reply Last reply
      0
      • C ChandraRam

        Johan Hakkesteegt wrote:

        I have an app that retrieves and calculates a lot of data. The whole process may take about 20 minutes. To prevent the user from thinking that the app has crashed, I added a progress bar, and to give the user a better idea of the progress, I make the form's title bar display a percentage. The problem is that at pretty much any percentage the form no longer updates itself. The application keeps running, no problem, but the progress bar and percentage in the title bar get stuck, which effectively defeats the purpose. Can anyone tell me why this may happen ?

        The UI will not respond so long as there are other things to do... looks like all this is in the same thread, maybe you can do your process in a separate thread?

        J Offline
        J Offline
        Johan Hakkesteegt
        wrote on last edited by
        #3

        Thanks for the response. The funny thing is though, that it does work for a while. At the moment the UI freezes, the app is retrieving data from a database with a succession of datareaders. In other words it is repeating the same task over and over (with different parameters each time ofcourse). If we consider your theory, why does the UI not freeze right away?

        My advice is free, and you may get what you paid for.

        C D 2 Replies Last reply
        0
        • J Johan Hakkesteegt

          Thanks for the response. The funny thing is though, that it does work for a while. At the moment the UI freezes, the app is retrieving data from a database with a succession of datareaders. In other words it is repeating the same task over and over (with different parameters each time ofcourse). If we consider your theory, why does the UI not freeze right away?

          My advice is free, and you may get what you paid for.

          C Offline
          C Offline
          ChandraRam
          wrote on last edited by
          #4

          Johan Hakkesteegt wrote:

          The funny thing is though, that it does work for a while. At the moment the UI freezes, the app is retrieving data from a database with a succession of datareaders. In other words it is repeating the same task over and over (with different parameters each time ofcourse). If we consider your theory, why does the UI not freeze right away?

          Your description of the problem reinforces my theory :) You usually find that the UI becomes unresponsive when there are repetitive tasks...

          1 Reply Last reply
          0
          • J Johan Hakkesteegt

            Thanks for the response. The funny thing is though, that it does work for a while. At the moment the UI freezes, the app is retrieving data from a database with a succession of datareaders. In other words it is repeating the same task over and over (with different parameters each time ofcourse). If we consider your theory, why does the UI not freeze right away?

            My advice is free, and you may get what you paid for.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            The UI thread is busy doing all of your operations. It would appear that every once in a while, the thread is freed to process the Window's message pump, thereby processing all the WM_PAINT messages for the window, which means you get to see your progressbar and window title updates. So long as the thread is busy doing other things, these paint messages do not get processed, thereby looking like the application hung. You have little choice but to move these operations to a seperate thread and have this processing code fire off progress messages every once in a while. The UI thread will be able to process these messages immediately, while your processing thread does it's job. You may want to look into using the BackgroundWorker class make this process easier.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            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