I’m currently developing for a handheld device running Windows XP Professional (not Tablet PC edition). The device allows users to switch from the standard widescreen landscape display format to a portrait one. I would like to know if there are any VB.NET code snippets to help me along with this task.
I’m currently developing for a handheld device running Windows XP Professional (not Tablet PC
Share
The way to determine the current orientation is with the
System.Windows.Forms.SystemInformation.ScreenOrientationproperty.To get the actual size of the screen, check
System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height(and.Width)You can declare an event handler (with the
AddHandlerstatement) forMicrosoft.Win32.SystemEvents.DisplaySettingsChangedas a trigger your app can respond to, and then check the screen orientation to see if you need to adjust your GUI layout.