I realized there are other questions about animation and probingbars, but to get rid of the animation they have drawn on it Think about the top of the progress bar, i.e. the highlight which runs on it.
What I want to do is to get rid of the animation when I set the new value of the progress bar. Now the problem to me is that the action which is being completed and the progress bar is increasing in their maximum position after that the action is completed. In other words, if I set the value of the value of the progress bar of 50, then I want to travel it half way (if maximum is 100), then in that situation, Do not gently build the progress bar as it is now. If there is a really question that already deals with it, then it is close to the duplicate and I happily remove it but I could not find any one. I've found it: and deals with this highlights which is animated, and that's not what I'm talking about. Here is a simple demo that shows the problem: Edit 1: This is Windows 7, Glass Theme, Yes, I bet it is special for 7 or possibly Vista. Here's a GIF-animation that shows the problem, from the above project you can see that The button is enabled, 1 second is set after the halfway mark, the progress bar animates to 100%, the after that button is enabled. As you can see above, setting back to enable the button and setting the progress bar to 100 is done "at the same time." Actually, I should not make progress progressive of the progress bar, Want to jump straight 50% and then up to 100% at the same time Because the button is enabled. Edit 2 : In response to David Hefranan's answer, in this way I have changed the above code: topic. Although there is an alternative solution. If you progress backwards, then animation is not shown. So if you want it to be immediately advances from 50, increase value of 51, then immediately decrease 1. You struggle closer to 100% because you set the maximum value 1000 to 1000, say, value 101 (say 'I' is set to maximum 100), say, increase by 1000, 999 short , And then go back to 1000. Still, this is very strange, but it has the benefit of giving you the desired effect!
void main () (var fm = new form ()) {var bt = new button {text = " Start ", location = new point (8, 8), parent = FM;}; Var pb = new progress bar {top = bt. Heating + BT Height + 8, width = FM. Client Rectangle With - 16, left = 8, parent = FM}; BTclick + = (S, E) = & gt; {Bt.Enabled = false; Thread T = New Thread (New Thread Start (() => {Thread.Sleep (1000); bt.BeginInvoke (New Action (() => {pb.Value = 50;})) Thread.Sleep (1000); Bt.BeginInvoke (New Action (() => {pb.Value = 100;}); BT.BegenInWolk (New Action ((=) = {BT. Enrated = true;}) }}}; T.Start ();}} fm.ShowDialog ();}}
bt.BeginInvoke (new action (=) {pb. Value = 51; pb.Value = 50;})); Thread.Sleep (1000); Bt.BeginInvoke (New Action (() => {pb.Maximum = 101; pb.Value = 101; pb.Maximum = 100; pb.Value = 100;}));
Comments
Post a Comment