should help you out In my program I import millions of records to a SQL Server database with the help of SqlBulkCopy class. Since this is a heavy lifting it takes quite some time. While the process goes on I want to show the progress in a progressbar control. To be notified for the rows copied I've done this: , You can have one extension class, like
public static class ControlExtensions
public static void Invoke(this Control control, Action action)
if (control.InvokeRequired) control.Invoke(new MethodInvoker(action), null);
fixed the issue. Will look into that further he solution I came up with is fairly simple, and works beautifully for my needs. I would simply make three labels, with different colors i need, and set their width accordingly. Also, by doing this, I was able to set progress bar height to as much I want.
//question size represents width of one question on progress bar. You just divide the width of the entire bar with number of possible questions (max)
int questionSize = 280 / num_possible_question;
int greenProgressSize = green * questionSize;
CGRect greenProgress = CGRectMake( 20, 95, greenProgressSize, 8 );
cell.greenLabel.frame = greenProgress;
int redProgressSize = (red+green) * questionSize;
CGRect redProgress = CGRectMake( 20, 95, redProgressSize, 8 );
cell.redLabel.frame = redProgress;
CGRect grayProgress = CGRectMake( 20, 95, 280, 8 );
cell.grayLabel.frame = grayProgress;
WinRT Slider draw secondary progress on top of primary progress?