如何在Vista/Win7中自动打开新的OpenFileDialog? [英] How to open new OpenFileDialog automatically in Vista/Win7?

查看:120
本文介绍了如何在Vista/Win7中自动打开新的OpenFileDialog?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Vista上,并且正在使用Microsoft.Win32.OpenFileDialog类.

I'm on Vista and I'm using Microsoft.Win32.OpenFileDialog class.

当我致电ShowDialog()时,会得到旧的 XP样式的对话框:

When I call ShowDialog() I get the old XP-style dialog:

如何在WindowsXP上获得新的 Vista样式的对话框并回退到旧的对话框?

How do I get the new Vista-style dialog with fallback to the old one on WindowsXP?

有些隆隆声:

我真的不明白为什么他们没有在Vista中替换对话框,而是保留了两者.现在,除非更新,否则旧版应用程序将永远不会打开新对话框.

I don't really understand why they didn't replace the dialog in vista, but kept both of them. Now legacy apps will never open new dialog, unless updated.

推荐答案

是的,您必须升级到.NET 4.0才能获取新对话框.如果您坚持使用3.5,则可以使用System.Windows.Forms.OpenFileDialog,它确实获得了更新以使用新的IFileDialog COM接口.

Yes, you'd have to upgrade to .NET 4.0 to get the new dialog. If you're stuck on 3.5 then you can use System.Windows.Forms.OpenFileDialog, it did get the update to use the new IFileDialog COM interface.

回退是自动的,但如有必要,您可以使用其AutoUpgradeEnabled属性来强制使用旧版.事实并非如此,.NET程序不太可能修改对话框.

The fallback is automatic but you can use its AutoUpgradeEnabled property to force legacy, if necessary. Which it is not, unlikely that a .NET program would modify the dialog.

这篇关于如何在Vista/Win7中自动打开新的OpenFileDialog?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆