View Poll Results: How to validate LostFocus event using Click event?

Voters
1. You may not vote on this poll
  • Click

    1 100.00%
  • Shortcut Keys Alt+(Letter)

    0 0%
Results 1 to 2 of 2

Thread: Shortcut Keys!

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Philippines
    Posts
    7

    Question Shortcut Keys!

    How can we use the Lost Focus event of the Text box by using the shortcut keys from the command button?

    Senario: Cursor is Parked to the TextBox
    Case 1. Click the CommandButton, the LostFocus event from the TextBox will be validated. - OK!

    Case 2. Press Alt+(Letter) from the CommandButton, the LostFocus event from the TextBox will not be validated. It will move directly to the CommandButton's code. - Not OK!

    Case 3. Putting the LostFocus event inside the CommandButton Click event is not applicable. - Dont use this code!
    e.g.
    Private Sub CommandButton1_Click()
    TextBox1_LostFocus
    Msgbox "Record Saved!"
    End Sub()

    Please Help! your answers will be highly appreciated!

    Thanks,
    Franz
    +639198505203

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    The LostFocus event happens when the control looses focus. So when click your button the event will fire if you have the focus in the TextBox. Second, if you want to assign a shortcut for that particular textbox, then use KeyUp or KeyDown event in the TextBox and simply set the focus to the command buton.

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