Designing forms to work on different resolutions and aspect ratios on Windows CE

Jason picture Jason · Jan 20, 2010 · Viewed 9.9k times · Source

I have a .NET 2.0 application that runs on Compact Framework. It has a bunch of different forms that were all originally designed to run on a specific device with a specific screen resolution. I'm now looking to get this application to run on some other devices that have very different screen resolutions (some have completely opposite aspect ratios where the screen is now taller than it is wide). My question is how can I change my forms to look good on these other screens?

This is a bit different from designing forms on the full framework since I have to design these forms to take up the full screen since the screens are so small. I've thought about creating separate forms for each type of screen orientation (e.g. MyForm_Wide.cs, MyForm_Tall.cs, etc). I'd like to be able to reuse the non-designer generated code that contains a lot of business logic that is tied to the UI controls. Maybe I could somehow use partial classes to make this happen (e.g. MyForm.cs somehow gets compiled into MyForm_Wide.Designer.cs, etc). I'd really like to avoid specifically compiled versions for each screen orientation. Another approach I've thought about is trying to rearrange some controls at runtime based on the determined screen size.

What do you guys think?

Answer

Bryan Batchelder picture Bryan Batchelder · Jan 20, 2010

We use the Orientation Aware Control framework by Clarius. It solves the problem of not only form factor, but also on devices that support it, change of orientation (screen rotation).

Perhaps the most distinctive aspect of mobile development with regards to traditional desktop development is the need to support an ever increasing range of device form factors.

For expert mobile developers it's no news that designing mobile applications that support multiple form factors, resolutions and screen orientations is a non-trivial, time-consuming and challenging endeavor. It's also generally evident that the built-in docking and anchoring features in .NET Compact Framework v2.0 is far from being sufficient.

The Orientation Aware Control allows designing and coding a single control or form with multiple layouts or skins that are automatically applied at run-time (and design-time) according to the available form factor, resolution and orientation. Its outstanding Visual Studio forms and user control designer integration and zero-code adaptive UI behavior make the Orientation Aware Control a must-have companion for any mobile shop targeting multiple devices, bringing back the productivity you need to focus on growing your business.