Results 1 to 4 of 4

Thread: [RESOLVED] Hotkeys

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2013
    Posts
    336

    Resolved [RESOLVED] Hotkeys

    Hi,

    can someone help, where am i going wrong, they're not working?

    Code:
    Private Sub SelectPrograms_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
            If e.Control And e.KeyCode = Keys.S Then
                If CheckBox1.Checked = True Then
                    CheckBox1.Checked = False
                ElseIf CheckBox1.Checked = False Then
                    CheckBox1.Checked = True
                End If
            End If
    
            If e.Control And e.KeyCode = Keys.P Then
                CheckBox2.Checked = True
                Seconds_Remain.Enabled = False
                CheckBox2.Enabled = False
            End If
    
            If e.Control And e.KeyCode = Keys.I Then
                Editor.Show()
                CheckBox2.Checked = True
                Seconds_Remain.Enabled = False
                CheckBox2.Enabled = False
            End If
        End Sub

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Hotkeys

    If e.KeyCode = Keys.P AndAlso e.Modifiers = Keys.Control Then
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Hotkeys

    Did you forget to set the forms KeyPreview property to True?

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2013
    Posts
    336

    Re: Hotkeys

    Quote Originally Posted by Edgemeal View Post
    Did you forget to set the forms KeyPreview property to True?
    Thanks bud, fixed it...

    http://msdn.microsoft.com/en-us/libr...eventargs.aspx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width