Results 1 to 2 of 2

Thread: Re: Using Ascii keycodes for a controls.....

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Location
    Sydney,NSW,Australia
    Posts
    1

    Post

    Private Sub myControl_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then
    KeyAscii = 0
    SendKeys "{tab}"
    End If
    End Sub

    I got the above code as one of your tips, I would like to the above to call another sub when the tab key is pressed.
    I have tried using keycode 9 for tab but it does not appear to work for me.
    Can someone help me with this
    yours Keith

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Post

    Try this.

    Private Sub myControl_KeyPress(KeyAscii As Integer)
    If KeyAscii = 9 Then
    Call <Your Function Here>
    End If
    End Sub

    BTW, You can get the whole set of ASCII code table from the MSDN, then it will resolve most of your probblem.


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