I'm consulting on a large .Net winforms project that has to be able to run in "Touch" mode so it can be operated using a touch screen interface. The application architecture already contains scaling logic for enlarging the fonts/display on the standard .Net forms and controls and the custom controls also handles the scaling.
The problem is that the application uses OpenFileDialog and SaveFileDialog which does not scale using the same logic (which is essentially adjusting the size of the Font property on the control and the forms recursively). I believe that these dialogs are essentially native Windows dialogs and the OpenFileDialog class are really just wrapper classes that expose a standard .Net interface to interact with them.
One solution could be to implement custom dialogs for these things, but that would probably be somewhat extensive work. What we really would like to do is to somehow scale the font size of this particular dialog (perhaps through some P/Invoke window-handle magic)?
I know that one solution for touch-enabling would be to adjust the font size of Windows in general, but that idea is not really catching on with this company, they would rather scale the app itself and leave the rest of the OS untouched.
So, any experience or ideas as to how you could scale these dialogs to a larger font? Or should we just bite the bullet and create custom dialogs for this?
I know that one solution for touch-enabling would be to adjust the font size of Windows in general, but that idea is not really catching on with this company, they would rather scale the app itself and leave the rest of the OS untouched.
The dialogs you refer to are part of "the rest of the OS" that they would rather leave untouched. You either use the common dialogs, being forced to increase the font scaling in control panel, i.e. system-wide, or re-implement those dialogs yourself.
An alternative might be to create a separate Windows desktop using the appropriate API, increase its font scaling, and execute the app there (i.e. let the app create, use, and destroy that desktop). Then, the app and all common dialogs would be scaled up. The app would never be seen with other apps on one screen, though, and you would have to take care of switching desktops in the app (I think). And you would not see anything but the app GUI when the app is active. No start button, no taskbar, no nuttin´. See for example http://www.codeproject.com/KB/cs/csdesktopswitching.aspx for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With