覆盖替换提示在SaveFileDialog [英] Override the replace prompt in a SaveFileDialog
问题描述
我使用的是 Microsoft.Win32.SaveFileDialog
来显示一个WPF应用程序保存文件对话框。我想更换文件显示上的提示或者是自定义窗口,或连接额外的按钮,给用户追加而不是替换的选项。
I am using a Microsoft.Win32.SaveFileDialog
to display a save file dialog box in a WPF application. I would like to display either a custom window, or en extra button on the prompt for replacing a file, to give the user the option of appending instead of replacing.
我知道这是可能的,因为微软Word中做到这一点。我怎样才能做到在WPF类似的东西?我不反对使用的DllImport
S,如果这是什么需要?
I know this is possible, because Microsoft Word does this. How can I achieve something similar in WPF? I am not averse to using DllImport
s, if that is what it takes...
推荐答案
自定义外壳对话框是一个棘手的事情,但它越来越可行不再支持Windows XP。 Vista和起来了大幅重新设计的对话,一个好处是,自定义对话框得轻松很多。尽管从本地code。该的Windows API code包但是具有非常不错的管理包装了IFileDialogCustomize COM接口。你会发现他们在壳牌\ CommonFileDialogs子目录。
Customizing the shell dialogs is a tricky thing to do, but it is getting feasible to no longer support Windows XP. Vista and up had a drastic redesign for those dialogs, one benefit is that customizing the dialog got to be a lot easier. Albeit from native code. The Windows API Code Pack however has very decent managed wrappers for the IFileDialogCustomize COM interface. You'll find them in the Shell\CommonFileDialogs subdirectory.
这篇关于覆盖替换提示在SaveFileDialog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!