C backgroundworker progress bar not updating

Konrad's code makes good points, but the code below shows how to accomplish your tasks. Value = (int)position; } }); } } } Yes, it was a model. Loop' was supposed to represent one of many different classes that needed calling depending on which button is pressed in my main program. Here is a technique to do everything your three classes do under one file and one class name. Run Worker Async(alphabet); } } private void button1_Click(object sender, Event Args e) { prepare To Run(); } private void background Worker_Do Work2(object sender, Do Work Event Args e) { var obj = (Background Worker)sender; string alphas = e.

To Int32(calc), c); } } } private void background Worker_Progress Changed2(object sender, Progress Changed Event Args e) { toolstripprogressbar.

To String(); } private void prepare To Run() { if (!

Run Worker Async(alphabet); if (background Worker1.

I have finished a program, and it does what I want it to do, but I feel I am "doing it wrong", even though it's seemingly efficient enough. Do Work += new Do Work Event Handler(background Worker_Do Work); background Worker1. Since your code basically just walks down the length of the string of characters, I modified this version to use a more efficient private void background Worker_Do Work(object sender, Do Work Event Args e) { var obj = (Background Worker)sender; string alphas = e.

I have prepared a small example of what I feel I am handling wrong with the namespace Status Strip Test { public partial class Form1 : Form { public Form1() { Initialize Component(); } private void prepare To Run() { if (! Is Busy) { background Worker1 = new Background Worker(); background Worker1. To String()); } } } } } namespace Status Strip Test { public class Strip Handler { public static void Update Status(Status Strip ss, String Status) { ss. Progress Changed += new Progress Changed Event Handler(background Worker_Progress Changed); } private void background Worker_Do Work_obsolete(object sender, Do Work Event Args e) { var obj = (Background Worker)sender; while (! Cancellation Pending) { foreach (char c in alphabet) { float calc = ((float)alphabet.

Do Work += delegate { Looping.loop(status Strip1); }; background Worker1. Run Worker Async(); } } private void button1_Click(object sender, Event Args e) { prepare To Run(); } } } namespace Status Strip Test { public class Looping { public static void loop(Status Strip strip) { Form1 Form1 = new Form1(); string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; while (true) { Message Box. Show("Time to loop"); foreach (char c in alphabet) { Strip Handler. Worker Supports Cancellation = true; background Worker1. To Int32(calc)); } } } The modified version below is going to create the string using a value that is supplied as the argument (so, now this code can be used for other string values). Text = Status; } }); } public static void Update Progress(Status Strip ss, long position, long len) { ss. Worker Reports Progress = true; background Worker1. = null) { Tool Strip Progress Bar tspb = (Tool Strip Progress Bar)ss. Since you have no need to change your Background Worker's event handlers, code them up in the Form's constructor: private const string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; public Form1() { Initialize Component(); background Worker1 = new Background Worker(); background Worker1. Cancellation Pending) { for (int i = 0; i private void prepare To Run() { if (!