Is it possible to trigger the Screen Rotation feature built into Windows 10?

Mugsy's RapSheet 196 Reputation points
2023-07-10T21:44:14.8533333+00:00

I have a Windows 10 tablet. The screen automatically rotates if I turn the tablet sideways.

I'd like to be able to trigger screen rotation via code (preferably VB.Net.) Is this possible, and if so, how?

TIA

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. David Lowndes 2,640 Reputation points MVP
    2023-07-10T23:02:58.22+00:00

    You may be able to do this with the ChangeDisplaySettingsEx API, by setting the dmDisplayOrientation accordingly. However, I note that the current documentation for the API doesn't mention being able to use DM_DISPLAYORIENTATION, when I feel sure it used to in the past - possibly because some display drivers didn't play the game properly.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.