How i can refresh the progress bar after every copy?I try different things without success.....The progress bar will only after the for loop are finished update to 100%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
try { double x=0,y=0,count=0; for (; count < copyCountTotal; ) { if ((copyCountX * (xSize + copyOffsetX)) > (x * (xSize + copyOffsetX))) { corelApp.ActiveSelection.Duplicate(x * (xSize + copyOffsetX), y); count++; x++; } else { x = 0; if (copyCountY <= ((ySize+copyOffsetY)/y)) { y -= ySize + copyOffsetY; } else { corelApp.ActiveDocument.InsertPages(1, false, 1); } } //os.OrderToFront(); Progress_Bar.Value = ((count / copyCountTotal)*100); TB_Info.Text = ((count / copyCountTotal) * 100).ToString(); corelApp.EventsEnabled = true; //corelApp.Optimization = true; //corelApp.Refresh(); corelApp.ActiveWindow.Refresh(); Thread.Sleep(200); } corelApp.ActiveSelection.Delete(); //corelApp.ActiveSelection.Move(-xSize * 2, 0); }
Theoretically, `corelApp.EventsEnabled = true;` should do the trick..
What type of object is that `Progress_Bar`?
If this is placed on a form, try also `YourForm.Repaint`. `YourForm` being the name of the form keeping the progress bar.
it is a WPF Progress Bari can't find a repaint function