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