top of page

Visual Basic [4] Tutorial Blog :


Lesson 4: Writing the VB Code.

In preceding lesson, you have learned how to design the user interface by inserting controls to the form and changing their properties. However, the controls will not function without adding VB code to them.

In this lesson, we shall learn how to write VB code for all the controls so that they can interact with events triggered by the users. Before learning how to write VB code , let me explain the concept of event-driven programming.

4.1 The Concept of Event-Driven Programming Visual Basic 2013 is an event driven programming language because we have to write code for each control so that it responses to certain events triggered randomly by the user. These events do not occur in a certain order. The events are usually triggered by user’s inputs. However, some events are not triggered by the user.

Example of events are load, click, double click, drag and drop, pressing the keys and more. Every form and and every control you place on the form has a set of events related to them. Some of the events are load, click, double click, drag and drop, pressing the keys and more.

To view the events, doubleclick the control (object) on the form to enter the code window. The default event will appear at the top part on the right side of the code window.

You need to click on the default event to view other events associated with the control. The VB code appears on the left side is the event procedure associated with the load event. Figure 4.1 illustrates the event procedure load associated with the default form.

Press Icon below for pdf


Featured Posts
Check back soon
Once posts are published, you’ll see them here.
Recent Posts
Archive
Search By Tags
No tags yet.
Follow Us
  • Facebook Basic Square
  • Twitter Basic Square
  • Google+ Basic Square
bottom of page