[Windows Mobile Software Development] alessandroame:
try this, is not too clean sorry:

Public Class display

'DEVICEMODE
<Runtime.InteropServices.DllImport("coredll.dll")> _
Friend Shared Function ChangeDisplaySettingsEx(ByVal lpszDeviceName As String, ByVal lpDevMode As Byte(), ByVal hwnd As IntPtr, ByVal dwflags As CDSFlags, ByVal lParam As IntPtr) As CDSRet
End Function
'Declare Function ChangeDisplaySettingsEx Lib "coredll.dll" (ByVal lpszDeviceName As String, ByVal lpDevMode As Byte(), ByVal hwnd As IntPtr, ByVal dwflags As CDSFlags, ByVal lParam As IntPtr) As CDSRet
Public Shared Function ChangeDisplayOrientation(ByVal degree As Integer) As String
Dim devMode As New devicemodeW()
devMode.dmFields = DM_Fields.DM_DISPLAYORIENTATION
If degree = 0 Then
devMode.dmDisplayOrientation = DMD.DMDO_0
ElseIf degree = 90 Then
devMode.dmDisplayOrientation = DMD.DMDO_90
ElseIf degree = 180 Then
devMode.dmDisplayOrientation = DMD.DMDO_180
ElseIf degree = 270 Then
devMode.dmDisplayOrientation = DMD.DMDO_270
End If

Dim ret As CDSRet = ChangeDisplaySettingsEx(Nothing, devMode.Data, IntPtr.Zero, 0, IntPtr.Zero)
Return (ret.ToString())

End Function

' from pinvoke.net

Public Enum DMD
DMDO_0 = 0
DMDO_90 = 1
DMDO_180 = 2
DMDO_270 = 4
End Enum

Public Enum DM_Fields
DM_DISPLAYORIENTATION = 8388608
DM_DISPLAYQUERYORIENTATION = 16777216
End Enum

Public Enum DM_Orient
DMORIENT_PORTRAIT = 1
DMORIENT_LANDSCAPE = 2
End Enum

' Flags for ChangeDisplaySettings
Enum CDSFlags
CDS_VIDEOPARAMETERS = &H20
CDS_RESET = &H40000000
End Enum

' Return values for ChangeDisplaySettings

Enum CDSRet
DISP_CHANGE_SUCCESSFUL = 0
DISP_CHANGE_RESTART = 1
DISP_CHANGE_FAILED = -1
DISP_CHANGE_BADMODE = -2
DISP_CHANGE_NOTUPDATED = -3
DISP_CHANGE_BADFLAGS = -4
DISP_CHANGE_BADPARAM = -5
End Enum

Public Class devicemodeW
Inherits SelfMarshalledStruct

Private _DM_Orient As DM_Orient
Private _DM_Fields As DM_Fields
Private _DMD As DMD

Public Sub New()
MyBase.New(192)
dmSize = CUShort(Data.Length)
End Sub
Public Property dmDeviceName() As String
Get
Return GetStringUni(0, 64)
End Get

Set(ByVal value As String)
SetStringUni(value, 0, 64)
End Set
End Property
Public Property dmSpecVersion() As UShort
Get
Return GetUInt16(64)
End Get

Set(ByVal value As UShort)
SetUInt16(64, value)
End Set
End Property
Public Property dmDriverVersion() As UShort
Get
Return GetUInt16(66)
End Get

Set(ByVal value As UShort)
SetUInt16(66, value)
End Set
End Property
Public Property dmSize() As UShort
Get
Return GetUInt16(68)
End Get

Set(ByVal value As UShort)
SetUInt16(68, value)
End Set
End Property
Public Property dmDriverExtra() As UShort
Get
Return GetUInt16(70)
End Get

Set(ByVal value As UShort)
SetUInt16(70, value)
End Set
End Property
Public Property dmFields() As DM_Fields
Get
'Return DirectCast(GetUInt32(72), DM_Fields)
Return _DM_Fields
End Get

Set(ByVal value As DM_Fields)
_DM_Fields = value
SetUInt32(72, CInt(value))
End Set
End Property
Public Property dmOrientation() As DM_Orient
Get
'Return DirectCast(GetInt16(76), DM_Orient)
Return _DM_Orient
End Get

Set(ByVal value As DM_Orient)
SetInt16(76, CShort(value))
End Set
End Property
Public Property dmPaperSize() As Short
Get
Return GetInt16(78)
End Get

Set(ByVal value As Short)
SetInt16(78, value)
End Set
End Property
Public Property dmPaperLength() As Short
Get
Return GetInt16(80)
End Get

Set(ByVal value As Short)
SetInt16(80, value)
End Set
End Property
Public Property dmPaperWidth() As Short
Get
Return GetInt16(82)
End Get

Set(ByVal value As Short)
SetInt16(82, value)
End Set
End Property
Public Property dmScale() As Short
Get
Return GetInt16(84)
End Get

Set(ByVal value As Short)
SetInt16(84, value)
End Set
End Property
Public Property dmCopies() As Short
Get
Return GetInt16(86)
End Get

Set(ByVal value As Short)
SetInt16(86, value)
End Set
End Property
Public Property dmDefaultSource() As Short
Get
Return GetInt16(88)
End Get

Set(ByVal value As Short)
SetInt16(88, value)
End Set
End Property
Public Property dmPrintQuality() As Short
Get
Return GetInt16(90)
End Get

Set(ByVal value As Short)
SetInt16(90, value)
End Set
End Property
Public Property dmColor() As Short
Get
Return GetInt16(92)
End Get

Set(ByVal value As Short)
SetInt16(92, value)
End Set
End Property
Public Property dmDuplex() As Short
Get
Return GetInt16(94)
End Get

Set(ByVal value As Short)
SetInt16(94, value)
End Set
End Property
Public Property dmYResolution() As Short
Get
Return GetInt16(96)
End Get

Set(ByVal value As Short)
SetInt16(96, value)
End Set
End Property
Public Property dmTTOption() As Short
Get
Return GetInt16(98)
End Get

Set(ByVal value As Short)
SetInt16(98, value)
End Set
End Property
Public Property dmCollate() As Short
Get
Return GetInt16(100)
End Get

Set(ByVal value As Short)
SetInt16(100, value)
End Set
End Property
Public Property dmFormName() As String
Get
Return GetStringUni(102, 64)
End Get

Set(ByVal value As String)
SetStringUni(value, 102, 64)
End Set
End Property
Public Property dmLogPixels() As UShort
Get
Return GetUInt16(166)
End Get

Set(ByVal value As UShort)
SetUInt16(166, value)
End Set
End Property
Public Property dmBitsPerPel() As UInteger
Get
Return GetUInt32(168)
End Get

Set(ByVal value As UInteger)
SetUInt32(168, value)
End Set
End Property
Public Property dmPelsWidth() As UInteger
Get
Return GetUInt32(172)
End Get

Set(ByVal value As UInteger)
SetUInt32(172, value)
End Set
End Property
Public Property dmPelsHeight() As UInteger
Get
Return GetUInt32(176)
End Get

Set(ByVal value As UInteger)
SetUInt32(176, value)
End Set
End Property
Public Property dmDisplayFlags() As UInteger
Get
Return GetUInt32(180)
End Get

Set(ByVal value As UInteger)
SetUInt32(180, value)
End Set
End Property
Public Property dmDisplayFrequency() As UInteger
Get
Return GetUInt32(184)
End Get

Set(ByVal value As UInteger)
SetUInt32(184, value)
End Set
End Property
Public Property dmDisplayOrientation() As DMD
Get
'Return DirectCast(GetUInt32(188), DMD)
Return _DMD
End Get

Set(ByVal value As DMD)
_DMD = value
SetUInt32(188, CInt(value))
End Set
End Property
End Class
Public Class ScreenMode

'DEVICEMODE
<Runtime.InteropServices.DllImport("coredll.dll")> _
Friend Shared Function ChangeDisplaySettingsEx(ByVal lpszDeviceName As String, ByVal lpDevMode As Byte(), ByVal hwnd As IntPtr, ByVal dwflags As CDSFlags, ByVal lParam As IntPtr) As CDSRet
End Function
'Declare Function ChangeDisplaySettingsEx Lib "coredll.dll" (ByVal lpszDeviceName As String, ByVal lpDevMode As Byte(), ByVal hwnd As IntPtr, ByVal dwflags As CDSFlags, ByVal lParam As IntPtr) As CDSRet

Public Function ChangeMode(ByVal degree As Integer) As String
Dim devMode As New devicemodeW()
devMode.dmFields = DM_Fields.DM_DISPLAYORIENTATION
If degree = 0 Then
devMode.dmDisplayOrientation = DMD.DMDO_0
ElseIf degree = 90 Then
devMode.dmDisplayOrientation = DMD.DMDO_90
ElseIf degree = 180 Then
devMode.dmDisplayOrientation = DMD.DMDO_180
ElseIf degree = 270 Then
devMode.dmDisplayOrientation = DMD.DMDO_270
End If

Dim ret As CDSRet = ChangeDisplaySettingsEx(Nothing, devMode.Data, IntPtr.Zero, 0, IntPtr.Zero)
Return (ret.ToString())

End Function

Public Sub SetLandscape()
Try
ChangeMode(90)
Catch ex As Exception
'MsgBox(ex.ToString)
End Try
End Sub

Public Sub SetPortrait()
Try
ChangeMode(0)
Catch ex As Exception
'MsgBox(ex.ToString)
End Try
End Sub
End Class

End Class

usage:

display.ChangeMode(angle)