WinForms (C#) 응용 프로그램에서 언어 메뉴 스트립과 사운드 버튼을 만들었지 만 전환 할 수있는 방법을 모르겠습니다.하나의 버튼에 여러 액션이 있습니다.
나는 소리를 멈추고 싶을 때 & 소리가 나면 소리를 멈추고 다시 소리가 나고 아이콘을 바꾼다. 마찬가지로, 언어 메뉴, "Localizable"을 사용하여 언어를 변경하고 처음에 다른 언어로 텍스트를 변경 한 다음 다시 두 번째로 돌아서는 방법은 무엇입니까?
using System.Globalization;
using System.Threading;
namespace Project
{
public partial class Form2 : Form
{}
private void Menu_LanguageSwitch_Click (object sender, EventArgs e)
{
//Switch to EN - what's here?
{
CultureInfo ci = new CultureInfo("en-US");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
System.ComponentModel.ComponentResourceManager res = new ComponentResourceManager(typeof(Form2));
res.ApplyResources(lbl_Status, "lbl_Status");
Menu_LanguageSwitch.Text = "Francais";
}
//Switch to French
{
CultureInfo ci = new CultureInfo("fr");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
System.ComponentModel.ComponentResourceManager res = new ComponentResourceManager(typeof(Form2));
res.ApplyResources(Menu_LanguageSwitch, "Menu_LanguageSwitch");
res.ApplyResources(label2, "label2");
res.ApplyResources(label3, "label3");
res.ApplyResources(label4, "label4");
res.ApplyResources(label5, "label5");
res.ApplyResources(label6, "label6");
res.ApplyResources(label7, "label7");
res.ApplyResources(label8, "label8");
res.ApplyResources(lbl_Status, "lbl_Status");
Menu_LanguageSwitch.Text = "Francais";
}
}
}
감사합니다, 초보자에 분명히 확인하십시오 :
여기 내 코드입니다. 저는 신참입니다.
StackOverflow에 오신 것을 환영합니다! [해당 제목에 "태그에"태그를 포함해야합니까? "] (http://meta.stackexchange.com/questions/19190/should-questions-include-tags-in-the-titles)를 참조하십시오. 여기서 컨센서스는 다음과 같습니다. "아니, 그들은해서는 안된다". –