Kevin Lewis

Is anyone else using the OrientationAwareControl It seems to work great after an orientation change, but I can't get the initial screen resolution to work correctly.

I have forms whose default resolution is QVGA. If I run them in the VGA Pocket PC emulator, they don't display correctly at first (it almost acts like it's trying to start in landscape mode, or maybe a scaled QVGA mode ... I don't know for sure). Then, if I flip orientation to landscape and back to portrait, the display works as expected.

Also, if I open the control in the designer and save it as VGA, it displays correctly from the first in the VGA emulator, no need to flip back and forth.

Has anyone else had this problem or otherwise know the solution

Thanks!


Re: .NET Compact Framework OrientationAwareControl Initial Resolution

Peter Nowak (Germany)

Hi,

if I'm not completly messing I think that you could create ressource files for different screen resolutions to be used by the Control.

By that, did you try out different resolutions by that way

Cheers, Peter





Re: .NET Compact Framework OrientationAwareControl Initial Resolution

Kevin Lewis

Hi, Peter,

Yes, I've created layouts/resources with that resolution and it works fine after flipping the phone into landscape and then back to portrait ... but it doesn't work right from the start.

So, yeah, I have every WM 5 Pocket PC resolution saved for this control. It comes up fine right from the start in the QVGA resolution (which is the default layout for the control), but not for the VGA phone or the VGA square phone.

Thanks,
Kevin




Re: .NET Compact Framework OrientationAwareControl Initial Resolution

Kevin Lewis

It appears that the DPI setting is the culprit here.





Re: .NET Compact Framework OrientationAwareControl Initial Resolution

Syed Faraz Mahmood

HI

well i have been using orientation aware control for almost an year , and it served me well. I am using 2 screen size QVGA and VGA ( in potrait and landscape). I haven't encountered the behaviour your are mentioning. I had a different problem , where the manifest resource name of the resoultion resources were different then expected by the resource manager, ( our source code hierarchy was different from what VS is expecting). due to which the control was unable to retrieve the desired resolution settings. But the problem was resolved using Logical Name attribute for the resources.

I think you might be right here , DPI may be the culpurit. I am using AutoScaleMode set to DPI. If that could help you.

Have you tried debugging into the orientationAwarecontrol, where it applies resources to the control. check if it is getting the correct resource

regards
faraz





Re: .NET Compact Framework OrientationAwareControl Initial Resolution

Kevin Lewis

Interesting! I had to set AutoScaleMode to None in order for the correct layout to be chosen. When I had it set to DPI, it seemed to scale the QVGA resolution to VGA instead of just choosing the VGA layout. Once I set it to None, it correctly chose the correct layout. It did this in both Portrait and Landscape mode.

I've not tried debugging into the control itself, no. Right now, it appears that setting AutoScapeMode to None is working for me. I've layed out all of the standard WM5 PPC resolutions. Do you see having None in there as possibly causing me problems later

Thanks, Faraz!




Re: .NET Compact Framework OrientationAwareControl Initial Resolution

nabeelfarid

I had the same problem as Kevin and his solution works I've just changed autoscalemode to NONE and now everything is ok;]
Thanks a lot. you made my day


I can not believe i never tried it.

Regards,
Nabeel





Re: .NET Compact Framework OrientationAwareControl Initial Resolution

SlaV

I've had the same problem as Kevin and his solution worksSmile I've just changed autoscalemode to NONE and now everything is ok;]
Thanks a lotSmile




Re: .NET Compact Framework OrientationAwareControl Initial Resolution

Kevin Lewis

Well, that's really cool. I'm glad I posted what I found and glad it helped.