Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Table of Contents

Chapter 3: User Interface Design: Visual Basic Controls and Events
Last change: February 13 2016 18:47:26.

3.8   Some Commonly Used Events

The preceding discussion focused on which VB controls to use and how to arrange them on a form. You will still need to place the code in the project before it will work the way you want. You have had a general idea that the code should be placed in certain events. The next question, naturally, is in which event to place specific code. This, of course, depends on what you want to accomplish. The following discussion considers various programming requirements and the proper events in which to place code.

Last change: February 13 2016 18:47:27.
  1. Naming Convention: Suggested Name Prefixes
  2. Setting the Tab Order
  • 3.8 Some Commonly Used Events
    1. Setting the Initial State at Runtime: The Form Load Event
    2. The Click Event: Buttons and List Boxes
    3. The CheckedChanged Event: Radio Buttons and Check Boxes
    4. SelectedIndexChanged and DoubleClick Events: List Box and Combo Box
    5. Viewing the Key Entered: The KeyPress Event
    6. Before the User Does Anything in a Control: The Enter Event
    7. As the User Leaves the Field: The Leave Event
    8. Summary of Events
    9. <<PreviousNext>>