PC Review


Reply
Thread Tools Rate Thread

VS2005: Progress Bar in Status Bar

 
 
joey.powell@topscene.com
Guest
Posts: n/a
 
      4th Apr 2006
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

 
Reply With Quote
 
 
 
 
Marius Groenendijk
Guest
Posts: n/a
 
      5th Apr 2006
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;

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>



 
Reply With Quote
 
joey.powell@topscene.com
Guest
Posts: n/a
 
      5th Apr 2006
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?

 
Reply With Quote
 
Larry Lard
Guest
Posts: n/a
 
      5th Apr 2006

(E-Mail Removed) wrote:
> 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?


Workaround: have a ToolStripStatusLabel, the same width as the
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

 
Reply With Quote
 
joey.powell@topscene.com
Guest
Posts: n/a
 
      6th Apr 2006
Hey Larry, your solution worked great. Thanks!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Status Progress Bar JT Microsoft Excel Programming 5 24th Jul 2008 12:09 AM
progress bar status CT Microsoft ASP .NET 3 27th Sep 2006 05:00 PM
STATUS BAR HAVING PROGRESS BAR NaeemUllah Asad via .NET 247 Microsoft Dot NET 1 29th Jun 2004 07:23 PM
Progress bar in status bar Ayende Rahien Microsoft Dot NET Framework Forms 2 1st Dec 2003 07:46 PM
Using a progress bar in the Status Bar Vijay Balki Microsoft C# .NET 1 23rd Sep 2003 06:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:53 AM.