Foro de elhacker.net

Programación => .NET (C#, VB.NET, ASP) => Mensaje iniciado por: SERGIO_@PRENDE en 11 Abril 2018, 03:47 am



Título: Meter controles de teclado en este ejemplo de AxWindowsMediaPlayer
Publicado por: SERGIO_@PRENDE en 11 Abril 2018, 03:47 am
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 presion de la tecla A
 
Código
  1.  If e.KeyCode = Keys.A Then ''GENERO
  2.            ButtonNORMAL_Click(sender, e)
  3.        Else
  4.        End If



Código
  1. Public Class Form1
  2.    Dim POSICION As Point
  3.    Dim ANTERIOR As Point
  4.    Dim BANDERA As Boolean
  5.    Dim ALTURA As Integer
  6.  
  7.    Private Sub AxWindowsMediaPlayer1_MouseMoveEvent(sender As Object, e As AxWMPLib._WMPOCXEvents_MouseMoveEvent) Handles AxWindowsMediaPlayer1.MouseMoveEvent
  8.        POSICION = Windows.Forms.Cursor.Position
  9.    End Sub
  10.  
  11.    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  12.        AxWindowsMediaPlayer1.uiMode = "NONE"
  13.        AxWindowsMediaPlayer1.Location = New Point(0, 0)
  14.        AxWindowsMediaPlayer1.Width = Me.Width
  15.        ALTURA = AxWindowsMediaPlayer1.Height
  16.        PanelCONTROLES.Location = New Point(0, PanelCONTROLES.Location.Y)
  17.        PanelCONTROLES.Width = Me.Width
  18.        ButtonNORMAL.Visible = False
  19.        ButtonNORMAL.Anchor = AnchorStyles.Right
  20.        ButtonCOMPLETA.Location = New Point(Me.Width - ButtonCOMPLETA.Width - 30, ButtonCOMPLETA.Location.Y)
  21.    End Sub
  22.  
  23.    Private Sub ButtonINICIAR_Click(sender As System.Object, e As System.EventArgs) Handles ButtonINICIAR.Click
  24.        If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
  25.            AxWindowsMediaPlayer1.URL = OpenFileDialog1.FileName
  26.            AxWindowsMediaPlayer1.stretchToFit = True
  27.        End If
  28.    End Sub
  29.  
  30.    Private Sub ButtonCOMPLETA_Click(sender As System.Object, e As System.EventArgs) Handles ButtonCOMPLETA.Click
  31.        Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
  32.        Me.WindowState = FormWindowState.Maximized
  33.        AxWindowsMediaPlayer1.Dock = DockStyle.Fill
  34.        PanelCONTROLES.Location = New Point(0, Me.Height - PanelCONTROLES.Height)
  35.        PanelCONTROLES.Width = Me.Width
  36.        ButtonNORMAL.Visible = True
  37.        ButtonCOMPLETA.Visible = False
  38.        BANDERA = True
  39.        Timer1.Interval = 1000
  40.        Timer1.Start()
  41.    End Sub
  42.  
  43.    Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
  44.        If BANDERA = True Then
  45.            If ANTERIOR <> POSICION Then
  46.                If PanelCONTROLES.Visible = False Then
  47.                    PanelCONTROLES.Visible = True
  48.                ElseIf PanelCONTROLES.Visible = True Then
  49.                    PanelCONTROLES.Visible = False
  50.                End If
  51.                ANTERIOR = POSICION
  52.            End If
  53.        End If
  54.    End Sub
  55.  
  56.    Private Sub ButtonNORMAL_Click(sender As System.Object, e As System.EventArgs) Handles ButtonNORMAL.Click
  57.        Timer1.Stop()
  58.        BANDERA = False
  59.        Me.FormBorderStyle = Windows.Forms.FormBorderStyle.Sizable
  60.        Me.WindowState = FormWindowState.Normal
  61.        AxWindowsMediaPlayer1.Dock = DockStyle.None
  62.        AxWindowsMediaPlayer1.Height = ALTURA
  63.        PanelCONTROLES.Location = New Point(0, Me.Height - PanelCONTROLES.Height - 45)
  64.        PanelCONTROLES.Width = Me.Width
  65.        ButtonNORMAL.Visible = False
  66.        ButtonCOMPLETA.Visible = True
  67.    End Sub
  68. End Class
  69.