Freetutes.com

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

Change Event and Click Events in Visual Basic 6

Change events (of TextBoxes, for instance) or Click events (e.g. for OptionButtons, CheckBoxes, ComboBoxes, and ListBoxes) happen on many standard VB controls whenever control contents changes for any reason, including:

  • Changes caused by user input;

  • Changes caused by program code or system actions;

  • Changes that happen in the underlying data of a bound control.

These events are most useful when you need to constantly monitor the overall state of data validity on the form, perhaps because you wish to decide whether particular controls (such as an OK button) should be enabled. In order to implement this type of behavior, you should write a general validation routine that checks the validity of the entire form and then call it from the appropriate Click or Change event procedures.

The Change event is less useful for keystroke validation, due to the fact that it fires so often (every time even a single character changes) but has no built-in way to cancel changes. You should leave keystroke validation to the KeyPress, KeyUp, and KeyDown event procedures, as described in previous sections of this chapter.

Related topics on Field-Level Validation Techniques

See Also


  

<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved