I have an app that is currently being built for a windows mobile 6 device and a CE5 device. The screens on these devices are different - one is landscape the other is portrait.
I need to display the app correctly on both devices. but was wondering what is the best way to approach this ?
1) 开发者_StackOverflow社区Should i find screen orientation from Windows.Forms.screens.... then simply create a form for each of the orientations? 2) make a form that has anchored controls (in some way) so it doesn’t matter the orientation. 3) Has Microsoft got some other way of doing this ?????
The app has an output type of windows Application.
Any ideas would be gratefully appreciated !
Thanks John
Option #1 (unique forms for each possible resolution) would make it extremely time consuming for you to add support for a third device with a new resolution in the future. Your best bet is to write forms that dynamically resize their controls to fit screens of various widths then allow them to scroll vertically. Don't forget that your windows mobile users can switch from portrait to landscape in the middle of using one of your forms.
My experience is that trying to dynamically ajust for different aspect ratios is time consuming and generates way too much complex and convoluted code. Often you want to not just anchor controls, you want to move locations and layout. I typically create a screen for landscape and one for portrait. I often use anchoring to have them scale (240x320 to 480x640 for example), but use completely separate Form code for the orientations. Keep the element names the same and separate your view code from your presenter and it's easy to maintain and extend.
精彩评论