IsBackground Property


Gets or sets a value indicating whether or not a thread is a background thread
All threads created by calling a Thread class constructor execute in the foreground by default
All threads which are part of a pool of worker threads maintained by the runtime execute in the background my default.


System.Threading.Thread myThread; 

myThread = new System.Threading.Thread(delegate() {});

myThread = new System.Threading.Thread( new System.Threading.ThreadStart(myMethod) );

public static void myMethod()
{}

myThread.SetApartmentState(System.Threading.Apartment.STA);
myThread.IsBackground = true;
myThread.Start()



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext