c# Console Like control - show/hide

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • piercy
    New Member
    • Aug 2007
    • 77

    c# Console Like control - show/hide

    Hi, Theres a part in my program that i cant know the length of time the process will take. This is not due to me but due to the API's im having to deal with. i know the group amount (ie. 3 groups) but i dont know how many are within that. So... ive set my progressBar1.Ma ximum = groups.Count;. However, if theres 100 items in that group it will look like the page is not doing anything. What im trying to achieve is a console like log on the screen where i can just put a string of what its currently doing. Id also like to show or hide this control. Now my first thoughts were a groupbox with a richTextBox inside but the groupbox doesnt have a show/hide(well i could not find it?). i have seen this in some installers where youve got a progress bar and then a show details arrow and ti drops down with a console log.

    Does anyone know of a control i could do this with? Also, any hints or tips with regards to this sort of output/ logging is very welcome.

    Thanks and rergards,
    Piercy
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    GroupBoxes have the Visible property which you can set True/False to.

    One of the thing I had done was make a custom control that contained a progressbar and a few labels (arranged in a fashion that I like)
    Then I gave the control methods for changing those labels to reflect what was going on ( "performing step a" etc etc) as well as dealing with the ProgressBar stuff.

    You could probably do something like that, if you wanted to re-use the functionality in other projects.

    Comment

    • piercy
      New Member
      • Aug 2007
      • 77

      #3
      Originally posted by Plater
      GroupBoxes have the Visible property which you can set True/False to.

      One of the thing I had done was make a custom control that contained a progressbar and a few labels (arranged in a fashion that I like)
      Then I gave the control methods for changing those labels to reflect what was going on ( "performing step a" etc etc) as well as dealing with the ProgressBar stuff.

      You could probably do something like that, if you wanted to re-use the functionality in other projects.

      ok, just installed something and realised i what i was thinking of is not what usually seen. i was expecting some sort of arrow (>) which on a click will show the details below. Although, after installing something i realised they actually use a button. So i think ill just use a button to hide/show it. Im also planning to use this logging to help with debugging. So im going to give the user the option to save the log. (might do auto saves for the last 10 logs or something.. not sure yet. With this in mind would it be better to use a string builder or just to append the text in the richTextBox already(ie. richTextBox1.Te xt += "text"; ).

      I dont know if it matters either way.. Although i think im going to have to use delgates(*cries * not good with these) as the method i want to log is being run in a background worker.


      Thanks once again,
      Piercy

      Comment

      Working...