1

I'm working on a .NET application for a handheld x86 device which has a 480*800 vertical screen. Everything works wonderful except when comes to a Open File / Save File design. The default OpenFileDialog and other similar dialogs are too big in width when shown, making Open button partialy out of screen and Cancel button total out of it. Actually user can resize the dialog after it's shown, but there exists a MINIMUM SIZE with width still bigger than 480.

As far as I can see there's no way to manipulate OpenFileDialog directly, nor to do any inheritance. The FileDialog which OpenFileDialog inherits from is not inheritable. And CommonDialog looks too far away. Googling shows some commercial dialog components which has lot of functions I don't want, a hacking solution ends up with a project with at least 4 brand new classes and some Win32 APIs and messaging mechanics i don't need either.

It's very simple, I just want a simple way to fix the width of OpenFileDialog to 480 or smaller. Any way around this?

Ge Rong
  • 416
  • 5
  • 17
  • 1
    If you need non-default behaviors, you're into the realm of needing a 3PC or making Win32 native API calls. The WinForms component is pretty limited. – Tetsujin no Oni Apr 12 '12 at 21:18
  • 1
    If it has a minimum size, it has it for a reason. In this case the best bet is probably going to be creating your own dialog. – Igby Largeman Apr 12 '12 at 21:23
  • @TetsujinnoOni I know, but that's what I don't like it here - the Win32 API is too powerful, it's like I have to start doing a openfiledialog from sketch. I'm trying to find a geniusly simple solution – Ge Rong Apr 12 '12 at 21:24
  • try these http://www.ookii.org/software/dialogs/ and this https://github.com/scottwis/OpenFileOrFolderDialog – coder Apr 12 '12 at 21:29

1 Answers1

1

Open file dialog is a system dialog. It means that your application has no control over it. It is controlled by user. If user wants to change its size in one application, it will gain new size in all applications, since this size is user's preference.

Purpose of common dialogs is providing standard UI parts to user. Imagine how uncomfortable for users it would be to search for file to open if every application would use its own OpenFileDialog.

However you can build your own dialog.

Dima
  • 1,717
  • 15
  • 34