-
Recent Posts
-
Recent Comments
- sidereal on Let the user draw polygons, move them, and add points to them in C#
- RodStephens on Let the user draw and move line segments snapping their positions to a snap grid in C#
- RodStephens on Let the user draw polygons in C#
- Javier on Let the user draw polygons in C#
- Javier on Let the user draw and move line segments snapping their positions to a snap grid in C#
Archives
- February 2019
- January 2019
- December 2018
- November 2018
- October 2018
- September 2018
- August 2018
- July 2018
- June 2018
- May 2018
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- February 2014
- January 2014
- December 2013
- October 2013
- August 2013
- June 2013
- December 2012
- September 2012
- July 2012
- June 2012
- November 2011
- May 2011
- April 2011
- February 2011
- December 2010
Categories
- .NET
- 3D
- 3D graphics
- ADO.NET
- algorithms
- animation
- API
- arrays
- attributes
- audio
- books
- C#
- C# programming
- calculations
- challenges
- classes
- clipboard
- coding
- combinatorics
- console
- controls
- cryptography
- curve fitting
- database
- debugging
- dialogs
- directories
- Drag and Drop
- drawing
- drawings
- enums
- Event
- events
- example program
- Excel
- extension methods
- extensions
- files
- finance
- fonts
- formatting
- forms
- fractals
- ftp
- games
- GDI+
- generic
- geometry
- globalization
- graphics
- html
- IDE
- image processing
- inheritance
- interfaces
- internationalization
- internet
- interoperability
- LINQ
- lists
- localization
- mathematics
- memory
- menus
- MessageBox
- methods
- miscellany
- multimedia
- network
- Office
- OOP
- operators
- parsing
- performance
- phone
- PowerPoint
- printers
- printing
- productivity
- programs
- puzzles
- recursion
- reflection
- registry
- regular expressions
- serialization
- settings
- SQL
- stories
- strings
- syntax
- system
- threading
- tips
- tools
- transformations
- Uncategorized
- user interface
- variables
- VBA
- web
- Windows Forms programming
- WMI
- Word
- wpf
- XAML
- XML
Meta
Category Archives: internationalization
Initialize TextBox contents for the computer’s locale in C#
Suppose you place numeric, currency, date, and time values in TextBox controls at run time. At design time, the program may have trouble reading those values if the computer running the program is not using the same locale that you … Continue reading
Display locale-aware sample dates and currency values in C#
This program uses the following simple CultureData class to store information about a locale. // A class to store cultre data. public class CultureData { // The CultureInfo. public CultureInfo Info; // Initializing constructor. public CultureData(CultureInfo info) { Info = … Continue reading
Make locale-aware methods use a new culture at runtime in C#
The example Change program locale at runtime in C# explains how to change a program’s locale and reload its controls for the new locale. However, that doesn’t change the thread’s current culture, which determines the formats used by locale-aware methods … Continue reading
List available culture codes in C#
This example shows how you can make a list of the culture codes that are available on the system. Several C# Helper examples deal with globalization including Localize a program in C#. To localize a program, you need to specify … Continue reading
Make a stopwatch in C#
This program is a simple stopwatch. When you click the Start button, the program changes the button’s caption to Stop and starts a Timer. As the stopwatch Timer runs, the program displays the elapsed time. Click the Stop button to … Continue reading
Print a calendar in C#
This example prints a calendar containing some text for each day. It’s mostly a matter of keeping track of where to draw things, but it also requires you to handle some confusing internationalization issues and there’s one potential gotcha. The … Continue reading
Get the name of the first day of the week in C#
Different cultures start the week with a different first day of the week. For example, some cultures start the week with Monday and others start it with Sunday. Usually it doesn’t matter which day is the first day of the … Continue reading
Display the local time and GMT in C#
This example uses a Timer to execute the following code every half second. // Update the clocks. private void tmrClock_Tick(object sender, EventArgs e) { // Display the local time. DateTime now = DateTime.Now; lblLocalTime.Text = now.ToLongTimeString(); lblLocalDate.Text = now.ToShortDateString(); // … Continue reading
Get date format information for the computer’s locale in C#
The System.Globalization namespace’s InstalledUICulture object provides lots of static methods giving information about numeric, date, and time formatting for the computer’s locale. This example adds a bunch of these values to a ListView control. The following code shows how the … Continue reading
Posted in internationalization, system
Tagged C#, C# programming, date format, date formats, date information, day format, day of week, day of week format, example, example program, format information, internationalization, localization, month format, number format, system, time format, Windows Forms programming
Leave a comment
Display sample formats for different locales in C#
This example loops through the system’s defined locales and displays sample numbers, currency values, dates, and times in each. When the program starts, the following code executes. private void Form1_Load(object sender, EventArgs e) { float float_value = 1234.56f; decimal dec_value … Continue reading