开发者

Custom text and dropdown button options in OpenFileDialog?

开发者 https://www.devze.com 2023-03-24 04:53 出处:网络
I\'ve recently tried the newest version of WinZip and saw the text and options in the \"Zip\" file d开发者_StackOverflowialog...

I've recently tried the newest version of WinZip and saw the text and options in the "Zip" file d开发者_StackOverflowialog...

How can I do this in C#?

By the way, if you haven't figured it out yet... I am talking about the Vista/7 Open File Dialog.

I would rather have code than a "you take [x] line(s) of code from [this article] to do [this] and figure out the rest yourself". If I could, I would have done that.


I went all Rambo on this and I used the win32 API functions to customize the dialog. Works only when my app runs elevated on Windows Vista or 7.

(Sorry for answering so late, but I forgot about this question...)


To my knowledge, no significant customization can be performed with the default open file dialogue. You'll have to create your own. This isn't too bad, since you can use a file browser control to do most of the complex stuff.


Edit: Apparently "file browser control" came from my imagination and not my memory. I can't find a standard Microsoft-issue file browser control. So your options are:

  • Download a third-party file browser control and integrate that into your dialogue.
  • (more likely) - approach your design problem from a different angle. What exactly does the Winzip dialogue do, and why do you want to replicate it?


You can use the IFileDialogCustomize interface to achieve the customization, but this can be very cumbersome and time-consuming and inflexible.

Another alternative is to use third party controls like Shell MegaPack which are controls for putting Windows Explorer like file/folder browsing in your own forms.

DISCLAIMER: I work for LogicNP Software, the developers of Shell MegaPack.

0

精彩评论

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

关注公众号