VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

Systems Analysis - System analysis and Design tutorial for Software Engineering

You are here: Visual Basic > Advanced VB6 tutorial > Chapter 5

Keystroke Events at Field and Form Level in VB6

The first line of defense against user error is to catch problems as the user presses each key. The following sections discuss how to use three Keystroke events to intercept, interpret, and modify each keystroke.

You can validate keyboard input on two different levels in VB:

  • You write validation code in the Keystroke events of each separate control. The validation code in a control's Keystroke event runs when that control has focus and the user presses keys on the keyboard.

  • The form also has the same Keystroke events that can intercept all keyboard input while that form is the application's active form. When form-level key handling is active, the form's Keystroke events receive the keystroke before the currentlyactive control's Keystroke events receive it. By default, form-level Keystroke handling is not enabled. We discuss how to implement form-level Keystroke handling in the section "Enabling Two-Tier Validation With the Form's Keypreview Property."

Following topics are covered in this topic

See Also


<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © | All Rights Reserved