在写一个程序,程序本身要求是多语言的,比如说程序设置英语的时候,那么打开的对话框是英语的,设置是法语,打开的对话框是法语。 我想了一个折衷的办法利用 hook 然后setDlgItemText和setWindowText来修改对话框的标签内容和标题。 现在我已经成功修改了openFileDialog,但是在修改saveFileDialog时出现了问题,保存文件对话框只有取消按钮和文件名那个标签可以修改,标题和其他的标签都不能修改。不知道谁碰到过这种情况没有
调试欢乐多
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");
}
}