Introduction to Code Window and Writing a Simple Program

Introduction to Code Window: VB objects can recognize many different events. The objects will not function unless you have written code to tell them what to do when the event happens. This means that for any event, you must write an event procedure telling VB what to do, so event procedures are lines of programming code that tell VB how to respond to a given event.

Double-clicking any, blank part of the form will open the code window. VB program code is entered in this window. It contains two drop-down list boxes. If you pull down the left hand box in the code window you will see a list of controls on your form. It you pull down the right hand box, you will see the list of events supported by the selected controls.

Code Window in VB
Code Window in VB

Writing The Code In Code Window

Code in Code Window
Code in Code Window

Leave a Reply

Your email address will not be published. Required fields are marked *