Mini Kabibi Habibi

Current Path : C:/Users/Public/Documents/DXperience 13.1 Demos/WinForms/CS/LayoutMainDemo/Modules/
Upload File :
Current File : C:/Users/Public/Documents/DXperience 13.1 Demos/WinForms/CS/LayoutMainDemo/Modules/Multilanguage.cs

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;

namespace DevExpress.XtraLayout.Demos {
    /// <summary>
    /// Summary description for Multilanguage.
    /// </summary>
    public partial class Multilanguage : DevExpress.XtraLayout.Demos.TutorialControl {
        public Multilanguage() {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            // TODO: Add any initialization after the InitForm call

        }

        System.Globalization.CultureInfo oldCulture;
        private void simpleButton1_Click(object sender, System.EventArgs e) {
            ShowForm("en");
        }

        protected void SaveCulture() {
            oldCulture = System.Threading.Thread.CurrentThread.CurrentUICulture;
        }
        protected void RestoreCulture() {
            System.Threading.Thread.CurrentThread.CurrentUICulture = oldCulture;
        }
        protected void ShowForm(string culture) {
            SaveCulture();
            System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(culture);
            Form form = new MultilanguageForm();
            form.ShowDialog();
            RestoreCulture();
        }
        private void simpleButton2_Click(object sender, System.EventArgs e) {
            ShowForm("de-DE");
        }
    }
}