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. Updating the status

Updating the status

Scheduled Pinned Locked Moved C#
databasedesign
5 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.
  • R Offline
    R Offline
    Rizwan Rathore
    wrote on last edited by
    #1

    Hi all, I am creating a text mining engine and after a button click i create inverted index and it takes quite a while to do so. Now i want some user interface to tell that something is in progress. i am using a static label lblStatus. and updating its value during different places in the function. but it doesnt work.. lblStatus.Text = "10% Completed"; and so on. but it is not working the label doesnot change it remain the same as it was in the start and when the index is completely created it shows 100% completed.... tell me how it will work.. or advise me wat other method should i use. Regards,

    S 1 Reply Last reply
    0
    • R Rizwan Rathore

      Hi all, I am creating a text mining engine and after a button click i create inverted index and it takes quite a while to do so. Now i want some user interface to tell that something is in progress. i am using a static label lblStatus. and updating its value during different places in the function. but it doesnt work.. lblStatus.Text = "10% Completed"; and so on. but it is not working the label doesnot change it remain the same as it was in the start and when the index is completely created it shows 100% completed.... tell me how it will work.. or advise me wat other method should i use. Regards,

      S Offline
      S Offline
      sathish s
      wrote on last edited by
      #2

      Use Application.DoEvents();

      R 1 Reply Last reply
      0
      • S sathish s

        Use Application.DoEvents();

        R Offline
        R Offline
        Rizwan Rathore
        wrote on last edited by
        #3

        Sir plzz explain a little coz i m relative new commer in C# Regards,

        S 1 Reply Last reply
        0
        • R Rizwan Rathore

          Sir plzz explain a little coz i m relative new commer in C# Regards,

          S Offline
          S Offline
          sathish s
          wrote on last edited by
          #4

          If you call DoEvents in your code, your application can handle the other events. Say, you are are updating the label text by 10% within a function. You wont be able to see updated label text messages until the function has completed its execution. If you use Application.DoEvents() just after the update ui code, the function will continue its execution and you UI will be updated

          label1.Text="20% completed";
          Application.Doevents();

          Have a look into this link http://msdn2.microsoft.com/en-US/library/system.windows.forms.application.doevents.aspx

          R 1 Reply Last reply
          0
          • S sathish s

            If you call DoEvents in your code, your application can handle the other events. Say, you are are updating the label text by 10% within a function. You wont be able to see updated label text messages until the function has completed its execution. If you use Application.DoEvents() just after the update ui code, the function will continue its execution and you UI will be updated

            label1.Text="20% completed";
            Application.Doevents();

            Have a look into this link http://msdn2.microsoft.com/en-US/library/system.windows.forms.application.doevents.aspx

            R Offline
            R Offline
            Rizwan Rathore
            wrote on last edited by
            #5

            thxx Sir, it is working exactly as i wanted it to :) Regards, -- modified at 11:21 Tuesday 9th May, 2006

            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