Skip to main content
.NET Framework Class Library
ThreadCurrentCulture Property

Gets or sets the culture for the current thread.

Namespace:   System.Threading
Assembly:  mscorlib (in mscorlib.dll)
Syntax
Public Property CurrentCulture As [%$TOPIC/66w76es3_en-us_VS_110_1_0_0_0_0%]
public [%$TOPIC/66w76es3_en-us_VS_110_1_0_1_0_0%] CurrentCulture { get; set; }
public:
property [%$TOPIC/66w76es3_en-us_VS_110_1_0_2_0_0%]^ CurrentCulture {
	[%$TOPIC/66w76es3_en-us_VS_110_1_0_2_0_1%]^ get ();
	void set ([%$TOPIC/66w76es3_en-us_VS_110_1_0_2_0_2%]^ value);
}
member CurrentCulture : [%$TOPIC/66w76es3_en-us_VS_110_1_0_3_0_0%] with get, set
function get CurrentCulture () : [%$TOPIC/66w76es3_en-us_VS_110_1_0_4_0_0%] 
function set CurrentCulture (value : [%$TOPIC/66w76es3_en-us_VS_110_1_0_4_0_1%])

Property Value

Type: System.GlobalizationCultureInfo
An object that represents the culture for the current thread.
Exceptions
ExceptionCondition
ArgumentNullException

The property is set to .

Remarks

The CultureInfo object that is returned by this property, together with its associated objects, determine the default format for dates, times, numbers, currency values, the sorting order of text, casing conventions, and string comparisons. 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 CultureInfoCurrentCulture property to learn how a thread's default culture is determined, and how users set culture information for their computers.

Beginning with the .NET Framework 4, you can set the CurrentCulture property to a neutral culture. This is because the behavior of the CultureInfo class has changed: When it represents a neutral culture, its property values (in particular, the Calendar, CompareInfo, DateTimeFormat, NumberFormat, and TextInfo properties) now reflect the specific culture that is associated with the neutral culture. In earlier versions of the .NET Framework, the CurrentCulture property threw a NotSupportedException exception when a neutral culture was assigned.

Examples

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.

Imports System.Threading
Imports System.Windows.Forms

Public Class UICulture : Inherits Form
    Sub New()

        ' Set the user interface to display in the 
        ' same culture as that set in Control Panel.
        Thread.CurrentThread.CurrentUICulture = _
            Thread.CurrentThread.CurrentCulture

        ' Add additional code. 
    End Sub 

    Shared Sub Main()
        Application.Run(New UICulture())
    End Sub 
End Class
using System;
using System.Threading;
using System.Windows.Forms;

class UICulture : Form
{
    public UICulture()
    {
        // Set the user interface to display in the 
        // same culture as that set in Control Panel.
        Thread.CurrentThread.CurrentUICulture = 
            Thread.CurrentThread.CurrentCulture;

        // Add additional code.
    }

    static void Main()
    {
        Application.Run(new UICulture());
    }
}
#using <system.dll>
#using <System.Drawing.dll>
#using <system.windows.forms.dll>

using namespace System;
using namespace System::Threading;
using namespace System::Windows::Forms;
ref class UICulture: public Form
{
public:
   UICulture()
   {

      // Set the user interface to display in the 
      // same culture as that set in Control Panel.
      Thread::CurrentThread->CurrentUICulture = Thread::CurrentThread->CurrentCulture;

      // Add additional code.
   }
};


int main()
{
   Application::Run( gcnew UICulture );
}
Version Information

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

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

Portable Class Library

Supported in: Portable Class Library
.NET Framework Security