OpenFileDialog.AutoUpgradeEnabled not working under Vista or 7?

If I specify OpenFileDialog.AutoUpgradeEnabled = true, my program still shows the old XP style dialog. Any idea why this will happen? This is after I included them in Main ()

[STAThread]
static void Main()
{
    Application.EnableVisualStyles();
    Application.Run(new Primary());
}

and this is my dialog code:

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();
}

So why doesn't AutoUpgradeEnabled work?

0
source share
2 answers

Avoid installation programFileDialog.ShowHelp=true. The property is ShowHelpnot compatible with the user interface of the Vista / 7 dialog box. An open file dialog will still display a question mark help icon.

+3
source

Windows Vista Windows 7, Microsoft Windows API: http://code.msdn.microsoft.com/WindowsAPICodePack. Windows 7.

0

Source: https://habr.com/ru/post/1667986/


All Articles