|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
VS2005: Progress Bar in Status BarI am trying to use a progress bar inside of my C#.net windows form
application. The status bar (naturally) only needs to be visible when the app is running a job. However, if I set visible=false for it then the panels to the right all shift to the left and take its place (until I set visible=true). This is very ugly! I need to be able to hide the progress bar, but maintain its footprint within its status bar panel. I have tried things like setting Spring=true and Spring=false, and I am even using absolute widths for all of the panels. There is no "alignment" for each panel, relative to the statusbar container. That would probably work, because then I could set the rightmost text panel to align right. Anyways, I can't make it work. This should be a piece of cake, but as far as I can tell it cannot be done. Does someone out there know how to make it work? JP Hi Joey,
Say you have progress bar with at least 2 panels don't use AutoSize on the panels if you don't have to AFAICS this works just fine ProgressBar pbar = new ProgressBar(); pbar.Parent = statusBar1; pbar.Size = new Size(statusBarPanel2.Width, statusBar1.Height); pbar.Location = new Point(statusBarPanel1.Width, 0); pbar.Value = 20; pbar.Visible = true; <joey.pow***@topscene.com> wrote in message Show quote news:1144187670.257867.19000@g10g2000cwb.googlegroups.com... >I am trying to use a progress bar inside of my C#.net windows form > application. The status bar (naturally) only needs to be visible when > the app is running a job. However, if I set visible=false for it then > the panels to the right all shift to the left and take its place (until > I set visible=true). This is very ugly! > > I need to be able to hide the progress bar, but maintain its footprint > within its status bar panel. I have tried things like setting > Spring=true and Spring=false, and I am even using absolute widths for > all of the panels. There is no "alignment" for each panel, relative to > the statusbar container. That would probably work, because then I could > set the rightmost text panel to align right. Anyways, I can't make it > work. > > This should be a piece of cake, but as far as I can tell it cannot be > done. Does someone out there know how to make it work? > > JP > Just verified that AutoSize=false on the status bar and all panels
within. That doesn't fix it. Remember that this is VS2005, if that makes a difference? Any other ideas, guys? joey.pow***@topscene.com wrote:
Show quote > I am trying to use a progress bar inside of my C#.net windows form Workaround: have a ToolStripStatusLabel, the same width as the> application. The status bar (naturally) only needs to be visible when > the app is running a job. However, if I set visible=false for it then > the panels to the right all shift to the left and take its place (until > I set visible=true). This is very ugly! > > I need to be able to hide the progress bar, but maintain its footprint > within its status bar panel. I have tried things like setting > Spring=true and Spring=false, and I am even using absolute widths for > all of the panels. There is no "alignment" for each panel, relative to > the statusbar container. That would probably work, because then I could > set the rightmost text panel to align right. Anyways, I can't make it > work. > > This should be a piece of cake, but as far as I can tell it cannot be > done. Does someone out there know how to make it work? ToolStripProgressBar, adjacent to it. In your app, ensure that the label's visibility is always NOT the progressbar's visibility. Probably have to play around with the Size to get it to look exactly the same size. -- Larry Lard Replies to group please |
|||||||||||||||||||||||