progress bar on a status bar 
Author Message
 progress bar on a status bar

I implemented your suggestion but have an issue I haven't been able to
resolve. My status bar is located at the bottom of the form and when I
resize the form while the progress bar is displayed, the progress bar is
moved to the top of the form due to the status bar having a bounds' Y value
of 3. I've tried to manually calculate this new Y value based on other
containers within the form but haven't had any success.

Any suggestions?

Thanks in advance.

Basil

Quote:


> > Create a status bar. Let's call it "StatusBar".

> > Add a Panel. Let's call it "ProgressPanel".

> > Create a progress bar. Let's call it "StatusProgressBar".

> > Create the DrawItem event for the status bar and put in the
> > following code:

> > private void StatusBar_DrawItem( object sender,
> >     StatusBarDrawItemEventArgs sbdevent )
> > {
> >     if( sbdevent.Panel = this.ProgressPanel )
> >     {
> >         this.StatusProgressBar.Bounds = sbdevent.Bounds;
> >     }
> > }

> > Works like a charm for me.

> > -c



> > > What is the best way to keep the overlayed progress bar associated to
> > a
> > > specific status bar panel while resizing the form and the progress bar
> > is
> > > displayed?

> > > Basil



> > > > You don't actually place the progress bar ON the status bar, you
> > place
> > > > it OVER the status bar:

> > > > // Determine point to position.
> > > > progressBar1.Location = new Point( ...);
> > > > progressBar1.Height = statusBar1.Height - 4;

> > > > Controls.Add( progressBar1 );
> > > > progressBar1.BringToFront();
> > > > progressBar1.Show();

> > > > // Use

> > > > // Or just hide and reuse later.
> > > > progressBar1.Dispose();

> > > > Chris R.



> > > > > how do i place a progress bar on a status bar panel?

> > > > > thanks,
> > > > > Rob



Sun, 22 May 2005 04:41:02 GMT  
 progress bar on a status bar
Oh, I forgot to add that you must add StatusProgressBar to the
Controls collection of the statusbar.

this.StatusBar1.Controls.Add( this.StatusProgressBar );

The Y coordinate is relative to StatusBar1, so if the progress bar
is contained within the statusbar, it will calculate correctly on
resize.

-c


Quote:
> I implemented your suggestion but have an issue I haven't been able to
> resolve. My status bar is located at the bottom of the form and when I
> resize the form while the progress bar is displayed, the progress bar
is
> moved to the top of the form due to the status bar having a bounds' Y
value
> of 3. I've tried to manually calculate this new Y value based on other
> containers within the form but haven't had any success.

> Any suggestions?

> Thanks in advance.

> Basil



> > > Create a status bar. Let's call it "StatusBar".

> > > Add a Panel. Let's call it "ProgressPanel".

> > > Create a progress bar. Let's call it "StatusProgressBar".

> > > Create the DrawItem event for the status bar and put in the
> > > following code:

> > > private void StatusBar_DrawItem( object sender,
> > >     StatusBarDrawItemEventArgs sbdevent )
> > > {
> > >     if( sbdevent.Panel = this.ProgressPanel )
> > >     {
> > >         this.StatusProgressBar.Bounds = sbdevent.Bounds;
> > >     }
> > > }

> > > Works like a charm for me.

> > > -c



> > > > What is the best way to keep the overlayed progress bar
associated to
> > > a
> > > > specific status bar panel while resizing the form and the
progress bar
> > > is
> > > > displayed?

> > > > Basil



> > > > > You don't actually place the progress bar ON the status bar,
you
> > > place
> > > > > it OVER the status bar:

> > > > > // Determine point to position.
> > > > > progressBar1.Location = new Point( ...);
> > > > > progressBar1.Height = statusBar1.Height - 4;

> > > > > Controls.Add( progressBar1 );
> > > > > progressBar1.BringToFront();
> > > > > progressBar1.Show();

> > > > > // Use

> > > > > // Or just hide and reuse later.
> > > > > progressBar1.Dispose();

> > > > > Chris R.



> > > > > > how do i place a progress bar on a status bar panel?

> > > > > > thanks,
> > > > > > Rob



Sun, 22 May 2005 04:47:27 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. progress bar on a status bar

2. progress bar in the status bar.

3. Progress Bar In A Status Bar

4. How to put a Progress Bar into the Status Bar

5. Progress bar is not showing on status bar

6. Progress Bar in Status Bar Pane

7. Progress bar in status bar

8. Adding a progress bar control to the status bar

9. progress bar in status bar

10. status bar hidden under START bar (quick-launch bar)

11. progress control on a status bar

12. Progress control in status bar?

 

 
Powered by phpBB® Forum Software