5

Possible Duplicate:
Disable WinForms ProgressBar animation

I'm using a progress bar for instrumenting some data coming from our radio and the 'shimmering' of it is unacceptable. Also, slow update rate data is animated to the value each time instead of instantly moving. This behavior does not provide the same visual experience one would expect from instrumentation. I realize the progress bar is not meant for this purpose but it's what's in my toolbox.

Using the 'pause' command from this link does not allow me to continue updating the value because it is paused. Changing back to normal, updating the value and then pausing again does not seem like a good solution. Also, the pause by default turns yellow so in addition to all the above I would need to turn the color back to green.

Can someone suggest how to turn this animation off or suggest a 3rd party 'instrumentation toolbox'?

CramerTV
  • 1,376
  • 1
  • 16
  • 29
  • What UI library are you using? Winforms? WPF? Something else? Why do you find it so “unacceptable” when Windows itself does the same? – svick Nov 30 '12 at 01:14
  • Not a duplicate, if it is about WPF. – philkark Nov 30 '12 at 01:19
  • Why not make a custom one, progress bars are pretty simple to make if you don't want fancy animation stuff – sa_ddam213 Nov 30 '12 at 01:20
  • I believe I'm using winforms since I don't know the first thing about WPF (I'm working through a tutorial now so hopefully I know more than nothing soon.) – CramerTV Nov 30 '12 at 01:24
  • @Jonathon, I saw that post and tried it but it does not allow me to continue updating the value because it is paused. Changing back to normal, updating the value and then pausing again does not seem like a good solution. Also, the pause by default turns yellow so in addition to all the above I would need to turn the color back to green. Not that I can't do it, it just seems like a lot of trouble to go through for something so simple. A colleague simply turned off the windows theme for the controls he didn't want animating using a C++ library that I don't appear to have access to with C#. – CramerTV Nov 30 '12 at 01:30
  • And thanks everyone for your comments and suggestions. It is very much appreciated that so many people are willing to help on their own time. – CramerTV Nov 30 '12 at 01:34
  • @sa_ddam213, Although I've been coding for 15 years or so I am very new to GUIs and don't know the first thing about making a custom one. I'll look into though since you say it is easy. Thanks for the suggestion. – CramerTV Nov 30 '12 at 01:35
  • If you want something VERY simple: Create a grid with border, add a coloured Rectangle into that grid, and keep changing the margin of the rectangle OR Just have a rectangle within a border and change the rectangles width. For the first case, you should give the grid the property `ClipToBounds = True`. – philkark Nov 30 '12 at 01:45

1 Answers1

3

Off the top of my head, this may work: Disable Visual Styles. In your Program.Main method, which Visual Studio has generated, you should see something like this:

[STAThread]
static void Main() 
{
    Application.EnableVisualStyles();    // Comment this out
    Application.Run(new Form1());
}

If you comment out that line, that may make your application look a bit "older" but I don't think you'll have the animated progress bar. Maybe that should help.

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
  • This is what I ended up doing since I wasn't able to find any other solution that allowed me to disable individual controls' styles. – CramerTV Dec 05 '12 at 21:22