用c#做了个Winform,如何让用户选择想要的语言,然后把界面语言转变成选择的语言? 

解决方案 »

  1.   

    通过资源文件实现或XML实现 
    配置资源文件如:Resource1.zh-CN.resx,Resource1.zh-TW.resx,Resource1.en-US.resx。 
    public static void SetLang(string lang, Form form, Type formType) 
            { 
                System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(lang); 
                if (form != null) 
                { 
                    System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(formType); 
                    resources.ApplyResources(form, "$this"); 
                    
                } 
            
      

  2.   

    有一个配置文件
    写好各个语言的界面用词
    然后根据选好的语言做替换
    或者说load