O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

STAThreadAttribute

Synopsis

This attribute can only be used on the Main method of an application. It sets the default threading model to STA (single-threaded apartment). Alternatively, you can use the MTAThreadAttribute attribute to use a multithreaded apartment model.

Like its counterpart, MTAThreadAttribute, this attribute has no meaning outside of COM interoperability.

public sealed class STAThreadAttribute : Attribute {
// Public Constructors
   public method STAThreadAttribute();  
}

Hierarchy

ObjectAttributeSTAThreadAttribute

Valid On

Method

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required