Export (0) Print
Expand All

Thread.CurrentUICulture Property

Gets or sets the current culture used by the Resource Manager to look up culture-specific resources at run time.

Namespace:  System.Threading
Assembly:  mscorlib (in mscorlib.dll)

member CurrentUICulture : CultureInfo with get, set

Property Value

Type: System.Globalization.CultureInfo
An object that represents the current culture.

ExceptionCondition
ArgumentNullException

The property is set to a null reference (Nothing in Visual Basic).

ArgumentException

The property is set to a culture name that cannot be used to locate a resource file. Resource filenames must include only letters, numbers, hyphens or underscores.

The UI culture specifies the resources an application needs to support user input and output, and by default is the same as the operating system culture. See the CultureInfo class to learn about culture names and identifiers, the differences between invariant, neutral, and specific cultures, and the way culture information affects threads and application domains. See the CultureInfo.CurrentUICulture property to learn how a thread's default UI culture is determined.

The CultureInfo returned by this property can be a neutral culture. Neutral cultures should not be used with formatting methods such as String.Format(IFormatProvider, String, Object[]), DateTime.ToString(String, IFormatProvider), and Convert.ToString(Char, IFormatProvider). Use the CultureInfo.CreateSpecificCulture method to get a specific culture, or use the CurrentCulture property.

NoteNote

The CultureInfo.CreateSpecificCulture method throws ArgumentException for the neutral cultures "zh-Hant" ("zh-CHT") and "zh-Hans" ("zh-CHS").

The following code example shows the threading statement that allows the user interface of a Windows Forms to display in the culture that is set in Control Panel. Additional code is needed.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft