Results 1 to 2 of 2

Thread: Very difficult question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Location
    jerusalem
    Posts
    72

    Unhappy Very difficult question

    Please make the following steps and try to answer me..
    (It looks simple but it is very difficult.....)
    1) Open a regular form.
    2) Add to this form textbox1,textbox2 and commandButton1.
    3) Set "Tab index" to all of these: textbox1.tabindex = 0
    textbox2.tabindex = 1
    commandButton1.tabindex = 2
    4)Write the next rows:
    Private Sub form_load()
    me.KeyPreview = True
    end sub
    5)Write the next rows:
    Private Sub Command1_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyTab Then Debug.Print "Tab pressed"
    end sub
    6)Run the App.
    7)Press the "Tab" button on the keyboard to pass through
    the objects
    8)----- Problem!!!!
    Please note that when the focus is on the commandButton and you press on the "Tab" button, the event(Command1_KeyPress) is not executed.
    My question is how can I indentify that the "Tab" button" was pressed?

    Thank you

  2. #2
    Junior Member
    Join Date
    May 2001
    Posts
    18
    try the following:

    1.set the caption of the commandButton1 with "&Ok"
    2.set all control's tabstop is false

    Press F5, Press Alt+O to set the focus, press TAB
    you'll find the event(Command1_KeyPress) is executed.


    for a good tool for programmer
    please visit: http://www.iCodeRepository.com

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