Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- C# - How to change value of a progress bar in a secondary thread
- .......
- bulkCopy.NotifyAfter = 2000;
- bulkCopy.SqlRowsCopied += new SqlRowsCopiedEventHandler(bulkCopy_SqlRowsCopied);
- .......
- public static class ControlExtensions
- {
- public static void Invoke(this Control control, Action action)
- {
- if (control.InvokeRequired) control.Invoke(new MethodInvoker(action), null);
- else action.Invoke();
- }
- }
- progressBar.Invoke(() => { progressBar.PerformStep(); };
- Task.Factory.StartNew(MyBulkCopyMethod);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement