Results 1 to 4 of 4

Thread: Disabling ALT in my program

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263

    Arrow

    When someone presses alt in an application, it selects the first menu or selects the menu in the control bar halting other actions currently going on in the application. How would I go about disabling this so that the program's functions aren't halted?

  2. #2
    Guest
    The Alt key is represented by the KeyCode 18, therefor if you reset the KeyCode when 18 is pressed, it will be omitted.

    Try this code. Put it in the KeyDown event of the form.

    Code:
    Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = 18 Then KeyCode = 0
    End Sub

  3. #3
    Lively Member
    Join Date
    Jan 2000
    Posts
    95
    okay, meg. all he asked for was a simple answer. not a whole story explaining how things work.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263
    Actually, thanks Megatron for explaining. It's just funny because I knew I could do that, it's just I immediatly accepted that it wouldn't work. I thought I would have to subclass the keyboard or something. Allright, well thanks a lot Megatron (Transformers rule - "Robot's in disguise" - I have the movie!!!).
    Phobic

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