Search code examples
windows-mobilescreen-resolutionscreen-orientation

Windows Mobile: dealing with screen orientation and resolution


I want to deveplop an app for Windows Mobile 5.0 and above that can detect screen resolution and orientation. This part is easy, I know how to do it. The other part, reallocate controls process, is more difficult for me (not very difficult).

I wonder if there is a design pattern or a design guideline about how to do this process of moving controls depending on form size. I don't want to use any other framework that can do it. I want to do it by myselft.

Any suggestions?

Thank you!


Solution

  • The key to this is anchoring and docking.

    Design the form for one screen resolution, I'd recommend you design for 240x320 and set your anchoring up correctly. Then when you flip it horizontally, the controls will automatically reposition.

    The only time I've physically written code to handle this is when I've got a number of buttons within an ImageButton menu that auto space themselves when the screen resolution is flipped.