Tutorial 3 : - Windows Programming Concepts

In this tutorial, basic Graphical User Interface (GUI) programming using Windows Forms, Menus and Buttons is covered. Sample applications such as Simple Interest and Name And Address will help you to familiarize with common frequently used codes and windows event handlers are illustrated in this tutorial. A brief explanation of all important components ontrols are given below.

The Visual Basic IDE is made up of a number of components

  • Menu Bar
  • Tool Bar
  • Project Explorer
  • Properties window
  • Form Layout Window
  • Toolbox
  • Form Designer
  • Object Browser

Menu Bar

This Menu Bar displays the commands that are required to build an application. The main menu items have sub menu items that can be chosen when needed. The toolbars in the menu bar provide quick access to the commonly used commands and a button in the toolbar is clicked once to carry out the action represented by it.

Toolbox

The Toolbox contains a set of controls that are used to place on a Form at design time thereby creating the user interface area. Additional controls can be included in the toolbox by using the Components menu item on the Project menu.

Control

Description

Pointer

Provides a way to move and resize the controls form

PictureBox

Displays icons/bitmaps and metafiles. It displays text or acts as a visual container for other controls.

TextBox

Used to display message and enter text.

Frame

Serves as a visual and functional container for controls

CommandButton

Used to carry out the specified action when the user chooses it.

CheckBox

Displays a True/False or Yes/No option.

OptionButton

OptionButton control which is a part of an option group allows the user to select only one option even it displays mulitiple choices.

ListBox

Displays a list of items from which a user can select one.

ComboBox

Contains a TextBox and a ListBox. This allows the user to select an ietm from the dropdown ListBox, or to type in a selection in the TextBox.

HScrollBar and VScrollBar

These controls allow the user to select a value within the specified range of values

Timer

Executes the timer events at specified intervals of time

DriveListBox

Displays the valid disk drives and allows the user to select one of them.

DirListBox

Allows the user to select the directories and paths, which are displayed.

FileListBox

Displays a set of files from which a user can select the desired one.

Shape

Used to add shape (rectangle, square or circle) to a Form

Line

Used to draw straight line to the Form

Image

used to display images such as icons, bitmaps and metafiles. But less capability than the PictureBox

Data

Enables the use to connect to an existing database and display information from it.

OLE

Used to link or embed an object, display and manipulate data from other windows based applications.

Label

Displays a text that the user cannot modify or interact with.

Project Explorer

Docked on the right side of the screen, just under the toolbar, is the Project Explorer window. The Project Explorer as shown in in figure servres as a quick reference to the various elements of a project namely form, classes andmodules. All of the object that make up the application are packed in a project. A simple project will typically contain one form, which is a window that is designed as part of a program's interface. It is possible to develop any number of forms for use in a program, although a program may consist of a single form. In addition to forms, the Project Explorer window also lists code modules and classes.

Properties Window

The Properties Window is docked under the Project Explorer window. The Properties Window exposes the various characteristics of selected objects. Each and every form in an application is considered an object. Now, each object in Visual Basic has characteristics such as color and size. Other characteristics affect not just the appearance of the object but the way it behaves too. All these characteristics of an object are called its properties. Thus, a form has properties and any controls placed on it will have propeties too. All of these properties are displayed in the Properties Window.

Object Browser

The Object Browser allows us to browse through the various properties, events and methods that are made available to us. It is accessed by selecting Object Browser from the View menu or pressing the key F2. The left column of the Object Browser lists the objects and classes that are available in the projects that are opened and the controls that have been referenced in them. It is possible for us to scroll through the list and select the object or class that we wish to inspect. After an object is picked up from the Classes list, we can see its members (properties, methods and events) in the right column.

A property is represented by a small icon that has a hand holding a piece of paper. Methods are denoted by little green blocks, while events are denoted by yellow lightning bolt icon.

Watch the youtube video of VB Simple Interest

Watch the Youtube Video of VB Name And Address Example



Download the source for VB Simple Interest

Download the source for VB Name and Address Example

   

 
Download VB In Easy Steps
Main Features
» Easy to learn VB.

» Tutorials with source & video.

» Can master within 9 hours.

» All VB concepts in detail.

» Become confident in VB applications.

» Cost effective.
   
Subscribe Newsletter
Register to the site for free, and subscribe to the newsletter. You will receive new articles and special content not available elsewhere on the site, right into your e-mail box!