Culture settings CodeSample - Setting in code

From Visual WebGui Wiki

Jump to: navigation, search


Contents

Overview

This samplecode shows how to set Culture in code as well as showing the difference between Visual WebGui and Windows Forms applications in setting Culture info.

VB.NET Code

Visual WebGui

System.Globalization.CultureInfo objCI = new System.Globalization.CultureInfo("En-US")
objCI.DateTimeFormat.ShortDatePattern = "yyyy-MM-dd"
VWGContext.Current.CurrentUICulture = objCI

Windows Forms

System.Globalization.CultureInfo objCI = new System.Globalization.CultureInfo("En-US")
objCI.DateTimeFormat.ShortDatePattern  = "yyyy-MM-dd"
Thread.CurrentThread.CurrentCulture    = objCI
Thread.CurrentThread.CurrentUICulture  = objCI

C# Code

Visual WebGui

System.Globalization.CultureInfo objCI = new System.Globalization.CultureInfo("En-US");
objCI.DateTimeFormat.ShortDatePattern = "yyyy-MM-dd";
VWGContext.Current.CurrentUICulture = objCI;

Windows Forms

System.Globalization.CultureInfo objCI = new System.Globalization.CultureInfo("En-US");
objCI.DateTimeFormat.ShortDatePattern  = "yyyy-MM-dd";
Thread.CurrentThread.CurrentCulture    = objCI;
Thread.CurrentThread.CurrentUICulture  = objCI;


Personal tools