MultiRow Windows Forms > Developer's Guide > Using MultiRow > Advanced Designer Features > Template Localization |
The template consists of language resources as per the localization framework of the .NET Framework, similar to the form (System.Windows.Forms.Form), and thus can be easily interchanged to display various languages. For details on the globalization support of Visual Studio and the .NET Framework, refer to MSDN Globalizing and Localizing Applications.
The following steps show how to create forms and templates which have Japanese and English resources.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("ja") Dim form As New Form2() form.ShowDialog() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("en") Dim form As New Form2() form.ShowDialog() End Sub |
private void button1_Click(object sender, EventArgs e) { System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ja"); Form2 form = new Form2(); form.ShowDialog(); } private void button2_Click(object sender, EventArgs e) { System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en"); Form2 form = new Form2(); form.ShowDialog(); } |
You can see the result of form localization with the above example.
The next example localizes the templates that are displayed in the GcMultiRow control.
When you click the Japanese button on Form1, the Japanese screen is displayed as shown below.
Click the English button on Form1 to display the English screen as shown below.