Does anyone know what my progress bar looks different in the Visual Studio designer than it does when i build and run my project?
In the designer i see the newer style. Progress is indicated with a solid green line with smoothed edges.
Whe开发者_如何学JAVAn I run my project the progress bar looks like the old style one. It has ten separate divisions that are blue rectangles.
Why the difference?
Make sure EnableVisualStyles is called before your form is loaded. This is usually in the program class before Application.Run.
Application.EnableVisualStyles();
Progress bars can have several different styles (as you have seen). While the designer should reflect the current style of the bar, it's possible it is simply showing a default style, while the progress bar is actually set to a different style.
You can change the ProgressBar.Style
property on the progress bar to control this. You can set it to: Blocks
, Continuous
or Marquee
- see here for the valid values and descriptions.
Is it running on a different PC, if so what you are seeing is the difference in windows themes.
If it is on the same machine it is not a behaviour I would have expected to see.
精彩评论