如果我指定OpenFileDialog.AutoUpgradeEnabled =真,我的程序仍显示旧的XP风格的对话框。 任何想法,为什么会发生这种情况? 这是后我让主题化在main()
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Primary());
}
这是我的对话框代码:
private void OpenProgramFile()
{
OpenFileDialog programFileDialog = new OpenFileDialog();
programFileDialog.Filter = "Program files (*.exe;*.lnk)|*.exe|All files (*.*)|*.*";
programFileDialog.FilterIndex = 0;
programFileDialog.Title = "Select program file";
programFileDialog.AutoUpgradeEnabled = true;
programFileDialog.ShowHelp = true;
DialogResult fileResult = programFileDialog.ShowDialog();
if (fileResult != DialogResult.OK)
return false;
programFileDialog.Dispose();
}
那么,为什么AutoUpgradeEnabled不行?