CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    up/down arrow ASCII controls

    i am looking for the ASCII numbers for:
    DELETE (the button)
    Up arrow
    Down arrow
    Left arrow
    Right arrow

    ASCII numbers as in 13 = ENTER, etc...


  2. #2
    Join Date
    May 1999
    Location
    Oxford UK
    Posts
    1,459

    Re: up/down arrow ASCII controls

    How about using the built in vb constants, eg :


    private Sub Form_Load()
    Debug.print "Delete = " & vbKeyDelete
    Debug.print "Up = " & vbKeyUp
    Debug.print "Down = " & vbKeyDown
    Debug.print "Left = " & vbKeyLeft
    Debug.print "Right = " & vbKeyRight
    Debug.print "Enter = " & vbKeyReturn
    End Sub




    That should produce :

    Delete = 46
    Up = 38
    Down = 40
    Left = 37
    Right = 39
    Enter = 13


    Chris Eastwood

    CodeGuru - the website for developers
    http://codeguru.developer.com/vb

  3. #3
    Join Date
    Jan 2000
    Location
    Yellowknifw, NT
    Posts
    5

    Re: up/down arrow ASCII controls

    The easiest way to find any key code is to insert the following line into a form and run the program.

    private Sub Form_KeyDown(KeyCode as Integer, Shift as Integer)
    Debug.print "Down " & chr(KeyCode) & " Number = " & KeyCode
    End Sub




    Puch keys to your hearts content

    Richard



  4. #4
    Guest

    Re: up/down arrow ASCII controls

    What are you planning to do with arrow keys? These may work on a form which has no command buttons. Since these are used to move through the various controls on the form. The Form_KeyPreview may allow you to trap all keys except these arrow keys. You are better off using a form without any command buttons, use stylish 3DPanels instead.
    Another option for you might be as follows.
    Use number keys on the NumPad with the NumLock ON.


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

Featured