|
||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
IntroductionThis is a simple progress bar control that imitates the XP visual style. The control inherits BackgroundFor the progress bar, I used the very nice progress bar control developed by Alan Zhao. Basically, the main functionality is provided by him, I improved the painting of the control to make it XP like. Control Properties
Control Methods
Painting code// The region of the progress bar!
int leftbar = 1;
int topbar = 1;
int X = this.Width-1;
int Y = this.Height-1;
Point[] points = { new Point(leftbar + 2, topbar),
new Point(X-2, topbar),
new Point(X-1, topbar + 1),
new Point(X, topbar + 2),
new Point(X, Y-3),
new Point(X-1, Y-2),
new Point(X-2, Y-1),
new Point(leftbar + 2, Y),
new Point(leftbar + 1, Y-2),
new Point(leftbar, Y-3),
new Point(leftbar, topbar + 2),
new Point(leftbar + 1, topbar + 1),
};
GraphicsPath path = new GraphicsPath();
path.AddLines(points);
Region reg = new Region(path);
e.Graphics.FillRegion(Brushes.White, reg);
This is the definition of the region of the progress bar. Points of InterestThe project is interesting if you want to learn how to simulate and to draw controls like they are drawn in Windows XP. HistoryNo history yet. ThanksThanks again to Alan Zhao for his great work. You can check out his work here. FeedbacksPlease vote for this article. And email me or leave your messages if you have:
|
|||||||||||||||||||||||||||||||||||||||||||||||