Apply Your Knowledge

Exercises

8.1. Using Localized Calendars

In addition to the features described earlier in the chapter, the CultureInfo class can supply localized calendars for different cultures. In this exercise, you'll see how you can retrieve culture-specific calendar information.

Estimated time: 20 minutes

1.
Open a Visual C# .NET Windows application in the Visual Studio .NET IDE.
2.
Add a new form to the application.
3.
Place a Label control, a ComboBox control (cboCultures), and a ListBox control (lbInfo) on the form.
4.
Switch to the code view and add the following using directive:
using System.Globalization;
5.
Add code to handle the Load event of the form and the SelectedIndexChanged event of the ComboBox control:
 private void Exercise8_1_Load( ...

Get MCAD/MCSD.NET Training Guide (Exam 70-316): Developing and Implementing Windows®-Based Applications with Microsoft® Visual C#™ .NET and Microsoft® Visual Studio® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.