Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

HotKey

Dr.Dr. Member Posts: 1
Hi guys! I need help! I have no idea how to create a hotkey press event handler. Can someone help me?
Thanks

Comments

  • ultimageultimage Member Posts: 119
    : Hi guys! I need help! I have no idea how to create a hotkey press event handler. Can someone help me?
    : Thanks
    :
    :
    you need to look at these events:

    .keydown
    .keypress
    .keyup

    each of them acts in a similar way and i dont think i need to explain them really.

    somethings simple would be maximizing and minimizing the window so i will show you how to do that really quick.


    create a new form and past this into it:

    [code]
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Me.KeyPreview = True
    End Sub

    Private Sub Form1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyUp
    If e.KeyCode = Keys.M Then
    Me.WindowState = FormWindowState.Maximized
    ElseIf e.KeyCode = Keys.N Then
    Me.WindowState = FormWindowState.Normal
    End If
    End Sub
    [/code]

    that should put you well on your way.
    Ultimage
    ultimage@insightbb.com

Sign In or Register to comment.