# [.net] Screen Rotation bug on some phones

## Recommended Posts

Hi! I'm fighting a bug for several hours now... I'm coding a game that needs to be in landscape mode. On the emulator, the HTC Touch Diamond and the HTC Touch HD2 my code works like a charm, but on the HTC Touch HD it doesn't. In the constructor of the main form I do a
Microsoft.WindowsCE.Forms.SystemSettings.ScreenOrientation =
Microsoft.WindowsCE.Forms.ScreenOrientation.Angle90;
That does it on the two mentioned phones. But the situation on the other phone is that: http://www.bitoholics.net/rotation_problem.png I already tried to: PInvoke ChangeDisplaySettingsEx from coredll.dll and set the screen to portrait, then set it to 90 degrees with the above code (Angle90). I tried only to set 90 degrees over ChangeDisplaySettingsEx... and I tried not to rotate the display at all. But it always shows in one of the cases shown in the picture. It kind of seems like that the phone doesn't really change to landscape (only the form does). Like the phone doesn't rotate the display, but only shows the content rotated... how can I fix that? Thanks! sepsys

##### Share on other sites
It looks like the phone is interpreting the angles 90 degrees from what they're supposed to be. Perhaps it considers 0 degrees to be facing right instead of facing up? I wonder if you just need to write special logic for that phone.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628293
• Total Posts
2981869

• 11
• 10
• 10
• 11
• 17