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. sprogress

sprogress

Scheduled Pinned Locked Moved C#
helptutorialannouncement
3 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.
  • P Offline
    P Offline
    picasso2
    wrote on last edited by
    #1

    I have a simple dialog box application that contains a listBox and a "start" button. When the application is started, it performs several basic functions. Right after the function is completed, a command to update the listbox (for example) -check if file exit ListBox1.Item.Add("checking for file"); -create a directory ListBox1.Item.Add("creating a direcory"); -copy a file ListBox1.Item.Add("copy file"); ........ The problem is that it performs all of the steps then at the end updates the listbox, all at once. I am trying to do somethinng like the "Windows Updates" any suggestions are appreciated pc

    P 1 Reply Last reply
    0
    • P picasso2

      I have a simple dialog box application that contains a listBox and a "start" button. When the application is started, it performs several basic functions. Right after the function is completed, a command to update the listbox (for example) -check if file exit ListBox1.Item.Add("checking for file"); -create a directory ListBox1.Item.Add("creating a direcory"); -copy a file ListBox1.Item.Add("copy file"); ........ The problem is that it performs all of the steps then at the end updates the listbox, all at once. I am trying to do somethinng like the "Windows Updates" any suggestions are appreciated pc

      P Offline
      P Offline
      peshkunta
      wrote on last edited by
      #2

      Not sure exaclty if this is where you are trying to go, but there should be a Refresh() or Update() function that udates the list as it progresses. If I understand correctly the list doesn't appear to update until the very end, correct? If that's the case, then it seems strange to me it usually should update redraw automatically when you update it withough the Refresh() or Update() functions. If you can, post a part of your code so we can see where exactly you're going wrong.

      P 1 Reply Last reply
      0
      • P peshkunta

        Not sure exaclty if this is where you are trying to go, but there should be a Refresh() or Update() function that udates the list as it progresses. If I understand correctly the list doesn't appear to update until the very end, correct? If that's the case, then it seems strange to me it usually should update redraw automatically when you update it withough the Refresh() or Update() functions. If you can, post a part of your code so we can see where exactly you're going wrong.

        P Offline
        P Offline
        picasso2
        wrote on last edited by
        #3

        Here is a snip of the code. I keep running basic stuff like this /////////////////////////////////////////////////////////////// string source="c:\\documents and settings\\all users\\Application Data\\Microsoft\\Dr Watson"; string destination="c:\\temp\\info\\"; //check if directory exist if(!Directory.Exists("c:\\documents and settings\\all users\\Application Data\\Microsoft\\Dr Watson")) { //do tnothing } else { DirectoryInfo di = new DirectoryInfo(source); FileInfo[] files = di.GetFiles(); foreach (FileInfo f in files) { string sourceFile = f.FullName; string destFile = Path.Combine(destination, f.Name); File.Copy(sourceFile, destFile); } } //update the listBox listBox1.Items.Add(">Getting DR. Watsons logs\t\tDone"); //******************************************************************************************* string arg1="C:\\Program Files\\Common Files\\Microsoft Shared\\MSInfo\\MSInfo32.exe"; string arg2="/nfo c:\\temp\\info\\SysReport.nfo"; Process nfo = Process.Start(arg1,arg2); nfo.WaitForExit(); //update the listBox listBox1.Items.Add(">Getting system information\t\tDone"); //////////////////////////////////////////////////////////////////////////////////////// the process perfroms all of teh functions but the listBox1 gets updated at the end thanX

        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