How about something like this:
using System.Drawing;
using System.Drawing.Drawing2D;
....
public void SetPercentComplete( int percent )
{
int width = (int)Math.Floor(pnlProgress.ClientRectangle.Width *
((double)percent)/100.0);
int height = pnlProgress.ClientRectangle.Height;
if( width > 0 && height > 0 )
{
pnlProgress.Invalidate(new Rectangle( pnlProgress.ClientRectangle.X,
pnlStatus.ClientRectangle.Y, width, height));
}
}
private void pnlProgress_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
if( e.ClipRectangle.Width > 0 )
{
LinearGradientBrush brBackground = new
LinearGradientBrush(e.ClipRectangle, System.Drawing.Color.FromArgb(255, 0,
0), Color.FromArgb(0, 255, 0), LinearGradientMode.Horizontal);
e.Graphics.FillRectangle(brBackground, e.ClipRectangle);
}
}
Tom Clement
Apptero, Inc.
"Thomas Kehl" <lh****@heeb.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi!
Does anyone have a tipp for me where can I found (or how can I programm) a
"progressbar" which has a gradient and the color go from the left side to
right and back ... I should have a waiting-progressbar :-)
Thanks
Thomas