开发者

WPF Open FIle Dialog theme

I'm using Microsoft.Win32.OpenFileDialog in my WPF application for selecting file:

var dlg 开发者_JS百科= new Microsoft.Win32.OpenFileDialog
{
    Title = "Select configuration",
    DefaultExt = ".xml",
    Filter = "XML-file (.xml)|*.xml",
    CheckFileExists = true
};

if (dlg.ShowDialog() == true)
{
//...
}

According to MSDN screenshots on Windows 7 dialog must have modern style, but I'm getting the old one:

WPF Open FIle Dialog theme

Adding manifest like in this question doesn't works. How to get dialogs like in MSDN shown?

EDIT:

First of all, I'm interested in "native" solution, not using third-party components.


You will get the correct dialog if you switch your target to the .Net 4.0 full or client profile.

Some of the modern common dialogs are only available in WPF if you use the Windows 7 Code Pack, but the new style open dialog is available when you target .Net 4.0.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜