Delay ProgressBar when setting a position using PBM_SETPOS

I have a simple C ++ / MFC dialog in which there is execution control. I set my position with the message PBM_SETPOS or MFC:

//CProgressCtrl myCtrl;
myCtrl.SetPos(position);

It works great, except when I need this position to develop rapidly, it seems to be behind.

Is there any way to remove this delay?

PS. I tried my application on the old version of Windows (with classic visual styles), and this lag is not there.

+4
source share
1 answer

, . , . , . , . SetPos(position+1), SetPos(position), . . , +1, +1, , . .

int lower, upper;
myCtrl.GetRange(lower, upper);
if (position >= upper)
{
    myCtrl.SetRange(lower, upper+1);
    myCtrl.SetPos(upper+1);
    myCtrl.SetPos(upper);
    myCtrl.SetRange(lower, upper);
}
else
{
    myCtrl.SetPos(position+1);
    myCtrl.SetPos(position);
}
+10

Source: https://habr.com/ru/post/1532242/


All Articles