none
Meter controles de teclado en este ejemplo de AxWindowsMediaPlayer RRS feed

  • Pregunta

  • Alguien me puede ayudar a meter controles de tecla en este proyecto y responda con teclas ordenes

    Deseo meter esta orden cuando este la pantalla completa obedezca la presión de la tecla A 

     If e.KeyCode = Keys.A Then
                ButtonNORMAL_Click(sender, e)
            Else
            End If

    Public Class Form1
        Dim POSICION As Point
        Dim ANTERIOR As Point
        Dim BANDERA As Boolean
        Dim ALTURA As Integer
     
        Private Sub AxWindowsMediaPlayer1_MouseMoveEvent(sender As Object, e As AxWMPLib._WMPOCXEvents_MouseMoveEvent) Handles AxWindowsMediaPlayer1.MouseMoveEvent
            POSICION = Windows.Forms.Cursor.Position
        End Sub
     
        Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
            AxWindowsMediaPlayer1.uiMode = "NONE"
            AxWindowsMediaPlayer1.Location = New Point(0, 0)
            AxWindowsMediaPlayer1.Width = Me.Width
            ALTURA = AxWindowsMediaPlayer1.Height
            PanelCONTROLES.Location = New Point(0, PanelCONTROLES.Location.Y)
            PanelCONTROLES.Width = Me.Width
            ButtonNORMAL.Visible = False
            ButtonNORMAL.Anchor = AnchorStyles.Right
            ButtonCOMPLETA.Location = New Point(Me.Width - ButtonCOMPLETA.Width - 30, ButtonCOMPLETA.Location.Y)
        End Sub
     
        Private Sub ButtonINICIAR_Click(sender As System.Object, e As System.EventArgs) Handles ButtonINICIAR.Click
            If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
                AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
                AxWindowsMediaPlayer1.stretchToFit = True
            End If
        End Sub
     
        Private Sub ButtonCOMPLETA_Click(sender As System.Object, e As System.EventArgs) Handles ButtonCOMPLETA.Click
            Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
            Me.WindowState = FormWindowState.Maximized
            AxWindowsMediaPlayer1.Dock = DockStyle.Fill
            PanelCONTROLES.Location = New Point(0, Me.Height - PanelCONTROLES.Height)
            PanelCONTROLES.Width = Me.Width
            ButtonNORMAL.Visible = True
            ButtonCOMPLETA.Visible = False
            BANDERA = True
            Timer1.Interval = 1000
            Timer1.Start()
        End Sub
     
        Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
            If BANDERA = True Then
                If ANTERIOR <> POSICION Then
                    If PanelCONTROLES.Visible = False Then
                        PanelCONTROLES.Visible = True
                    ElseIf PanelCONTROLES.Visible = True Then
                        PanelCONTROLES.Visible = False
                    End If
                    ANTERIOR = POSICION
                End If
            End If
        End Sub
     
        Private Sub ButtonNORMAL_Click(sender As System.Object, e As System.EventArgs) Handles ButtonNORMAL.Click
            Timer1.Stop()
            BANDERA = False
            Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
            Me.WindowState = FormWindowState.Normal
            AxWindowsMediaPlayer1.Dock = DockStyle.None
            AxWindowsMediaPlayer1.Height = ALTURA
            PanelCONTROLES.Location = New Point(0, Me.Height - PanelCONTROLES.Height - 45)
            PanelCONTROLES.Width = Me.Width
            ButtonNORMAL.Visible = False
            ButtonCOMPLETA.Visible = True
        End Sub
    End Class


    miércoles, 11 de abril de 2018 14:13