Visual Programming Integrated Development Environment

Visual Basic IDE

Visual Basic integrated development environment includes tool, forms, properties window, form layout window, menu bar and standard tool bar.  It provides coding area as well as the standard exe component which can be used as canvas for adding new forms and other controls. It also includes compilers and cousins of compilers, providing convenient environment like using period . operator  to access properties and methods of any control or object. It also provides pre compilation that helps the programmer to review its code before compilation and static checker replaces some error prone code with proper code.

Form

Form is the first most object used in Visual basic. It is that starting point of any project. It is the main object of any application. All the projects require a user interface for doing some tasks. Other controls are placed on the form. The form can be retrieved by selecting standard exe. Initially form is called “Form1”. Every form in the project must have its own window, interface. Form is the window , working area in the project. We can add so many forms as we require.

Tool Box

Visual Programming stats with different controls and tools. The word tool and controls are alternatively used. Control, tool is also considered as object and component. Object is something that has state and behavior. State defines the characteristics of an object and behavior tells us what an object can do. These controls are used for creating Graphical User Interface. They are pointer, picture box, text box, labels, frame, command buttons, check box, option button also called radio button.  Horizontal and vertical scroll bars, timer, image, directory , drive list and file list, lines, shapes and data control.

Every control has certain properties, methods and events. Certain event procedures are programmed to perform certain tasks.

Properties Window

Properties are the attributes of an object, which are used to define the characteristics of an object such as name, size and color. Properties window is used to set and change the properties of an object or control. These properties can be changed at design time or some properties can be changed at run time. Some of the properties can only be changed at design time like the name of an object. Properties window do have 2 different type of views Alphabetic view and Categorized View.

Form Lay out window

Form layout window sets the position of the form before executing it. It sets the position of form on screen at which location the form has to be displayed. The position of the form can be changed by simply dragging the form with the mouse pointer to the desired location. We can add this layout window by clicking the view menu and select Form layout.

Project Explorer Window

As the name suggests, project explorer explores the whole project in a certain window to easily view and navigate the forms, modules, dialogs in the whole project. We may also add different types of other data binding controls like data environment, crystal reports, data reports. To easily show and select these controls we use project explorer.  It contains Toggle forms, view code and view object buttons.

Code window

Every program comprises of different controls, forms and the code require to perform some task. Code window contains the statements of visual basic that are executed when some event occurs. It may contain may pieces of code. Every piece of code is related to particular event of a particular object. That piece of code run when user clicks a button or perform some other events. The code window has two list boxes on the top. Left list box contains all objects in your application. The right list box contains all the events of the select object.

Managing Controls

Visual Basic provides many controls for developing applications. Controls are also called tools and objects. These tools are used to design the Graphical User Interface. Each control has its own properties, methods and events.

Objects Properties

Properties are used to define the characteristics and physical appearance of any object. Such as name property is set to access that object by defining its name. Different types of values are assigned to different properties.

Types of Properties

String Values

This type of value is normally entered by the user or programmer normally name property, tool tip text and some other are given by the programmer during design time.

Boolean Values

Boolean values consists of only two possible values which are true and false.  We can select any one from that like enabled = true or false.

Predefined Values

Some properties have predefined list of possible values, which are to be set by selecting one value from the available list like mouse pointer property and its different values.

Hexadecimal Value

We can also assign some values in hexadecimal form. Color properties can be given hexadecimal values. Alternatively we can select a color from the color palate.

File name value

Some properties require the name of the file and its location information as its value. Such properties have an ellipse in the value box. We may select any file in our computer by clicking the ellipse. Icon, picture property can be assigned the name of the file as their property value.

Assigning values at Run Time

Object Methods

Methods are the predefined working of an object. Each method consists of Visual Basic statement. These statements are executed when the user invokes the method. This method invoking is called method call. Each method performs some action. All objects have a list of predefined methods. We may use the name of the object and then period . operator and then a drop down list will show all the properties and methods of the object. We may select from this list to execute the method.

Form1.show

Form1.cls

Form1.print

Difference between Properties and Methods

Properties are the attributes or characteristics of objects but methods are the working of objects. When we are using any property then we must assign some values to that property of an object. When we invoke the method, we are looking some action to be performed.

Methods are the readymade code that can be executed again and again. Properties can be used either at design time and run time but methods can be executed only at run time.

Object Events

Events are the certain activity which performs some action. When the user click the mouse, press any key then an event occurs. Windows operating system continuously monitors the running visual basic program, waiting for some event to be occurred. Visual Basic programs are event driven. It means that the code will run only when the certain event occurs.  An object has its own set of events, but many events are common to all objects.

Event Procedure

An event procedure is a piece of code that is executed when an event occurs. It is also known as event handler. An object can have different event procedure for different events. One event procedure may execute when the user click with the mouse and another may execute when the user presses a particular key.

Windows operating system monitors the running program. When the user clicks a command button or performs any other kind of event, operating system captures that event and sends it to the Visual Basic. When Visual Basic gets an event from windows, it firstly checks whether the programmer wrote an event procedure for this event. If an event procedure exists, Visua

Post a Comment

17 Comments