Tag Archives: background

Run threads with different priorities in C#

This example runs several different threads at different priorities. Each of the threads executes the following Counter class’s Run method. class Counter { // This counter’s number. public string Name; // Initializing constructor. public Counter(string name) { Name = name; … Continue reading

Posted in algorithms, programs, system, threading | Tagged , , , , , , , , , , , , , , , , , , , , | Leave a comment

Make a moving background in C#

This example displays text with a moving background color gradient. The following ShadeRect method contains the program’s most interesting code. // Fill the rectangle with a gradient that // shades from red to white to red. private void ShadeRect(Graphics gr, … Continue reading

Posted in drawing, graphics | Tagged , , , , , , , , , , | 1 Comment

Use a BackgroundWorker in C#

This example shows how to use a BackgroundWorker component to easily perform a task in the background while the program continues running. The example Use multiple threads to draw a graph in C# lets you perform an action in the … Continue reading

Posted in controls, programs, threading | Tagged , , , , , , , , , , | 8 Comments