Mostrando entradas con la etiqueta DETECTAR ROTACIÓN PANTALLA. Mostrar todas las entradas
Mostrando entradas con la etiqueta DETECTAR ROTACIÓN PANTALLA. Mostrar todas las entradas

DETECTAR ROTACIÓN PANTALLA

Inherits System.Windows.Forms.Form

Private Sub form_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        AddHandler Microsoft.Win32.SystemEvents.DisplaySettingsChanged,
      AddressOf DetectScreenRotation

End Sub

Public Sub DetectScreenRotation(ByVal sender As System.Object,
      ByVal e As System.EventArgs)
        Dim theScreenBounds As Rectangle
        theScreenBounds = Screen.GetBounds(Screen.PrimaryScreen.Bounds)

        If (theScreenBounds.Height > theScreenBounds.Width) Then
           'acción para pantalla en horizontal
         Else
           'acción para pantalla en vertical
        End If
    End Sub
  

End Class