hmm the project is a bit complex for me to upload but i can show the progressbar code:
then..just add a statusbar to ur form and add an owner drawn item.Code:public class ProgressBarStatusBar : StatusBar { private int _progress = 0; public int Progress { get { return _progress; } set { if (value >= 0 && value <= 100) { _progress = value; Refresh(); } } } public ProgressBarStatusBar() { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); UpdateStyles(); } protected override void OnDrawItem(StatusBarDrawItemEventArgs e) { if (e.Panel.Style == StatusBarPanelStyle.OwnerDraw) { Graphics g = e.Graphics; g.FillRectangle(new SolidBrush(SystemColors.ActiveCaptionText), e.Bounds.X, e.Bounds.Y, GetPercentage(e.Bounds.Width), e.Bounds.Height); base.OnDrawItem (e); } } private int GetPercentage(int panelSize) { return Convert.ToInt32( (double)panelSize * (double)_progress / (double)100); } } }
to put a value to the progressbar do the following:
((StatusBarProgressBar)statusBar1).Progress = 50;




Reply With Quote