I have a bit of code in my project like shown below,here what is the usage of STA thread ? What i know about STA is it is Single Threaded Apartment,it is only required when using COM components.And it is used in the main entry of the application.
/// <summary>
/// The main entry point for the application.
///
/// Command line:
/// Leaf.exe /s server-name
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.DoEvents();
Application.Run(new Leaf()); // Leaf is a constructor
}