LATEST UPDATES

Search This Blog

Chapter 1: Introduction to Visual Basic

Wednesday, September 4, 2013

Chapter 1: Introduction to Visual Basic

          VB is a programming language, used to develop Windows based application program for clients and servers with Graphical User Interface (GUI). It is developed by Microsoft Corporation. Its editions are Learning Edition (introductory editions for students), Enterprise Edition (for team work programmers), and Professional Edition (for professional developers). Data base programs can be developed by using VB. Its latest version is 6.0.
Event Driven Programming
          VB is an example for Event Driven Program, because collections of codes are executed, according to the response of an event. In Windows operating system codes are executed when an event occurs.
Integrated Development Environment (IDE)
          The working environment of VB is called IDE. It has many functions to design, edit, compile and debug. So it is termed as integrated. Also it is a development environment for developing application programs. It has 3 states Design, Run and Debug.
VB IDE Components
          Title bar, Menu bar, Tool bar, Toolbox, Form designer, Project explorer, Properties window, Form layout window and Code editor window.
Title bar
          It displays the name of project (Project1 as default), IDE state (Design, Run and Debug), Minimize, Maximize/restore and close buttons.
Menu bar
It displays the menu options for the all IDE states. They are File, Edit, View, Project, Format, Debug, Run, Query, Diagram, Tools, Add-Ins and Help.
Toolbar
It provides quick access for menu options for opening new project, add form, open, save etc.
Toolbox
          It provides a set of tools (controls/objects) are used to design the user interface. It includes Pointer, picture box, Label box, Textbox, Frame, Command button, Checkbox, Option button, Combo box, List box, Hscroll, Vscroll, Timer, Drive list box, Dir list box, File list box, Image box, data etc.
Form designer
          It is the window for customize the use interface. Here we can add controls or objects for the interface from tool box.
Project explorer
          It displays the component of a project like forms and modules of a current project. It has 3 buttons for code, object and folder.
Properties window
It displays the property setting of a selected control. So it sets the appearance and behavior (characteristics) of an object.
Form layout window
          It allows displaying and repositioning the starting position of a form when the program is run.
Code editor window
          It serves us to entering the application code. It has 2 drop down lists one for Object selection and another for procedure.
VB Project
          A project is a collection of files used to build an application. Every application is developed as a project with one form. Here the default name of project is Project1 and form is Form1.
A VB project includes the following files with extension
One project files with extension .vbp
One file for each form with extension .frm
One file for control’s property with extension .frx
One file for each class module with extension .cls
One file for each standard module with extension .bas
Project File
          It coordinates the overall project. It contains the list and settings of all the components in a project.
Forms
          It is the basic building block of a VB application for the user interface, because without form we cannot design an application program. It is also called canvas of an artist, because we design the user interface by using the form by placing appropriate controls from tool box. All the other controls are placed in the form, so form is called container control.
Modules
          It has no visual interface. It has a code window. It is used to store the procedures and codes for more than one form in a project.
Properties, Methods and Events
          All the controls have its Properties, Methods and Events. Properties are characteristics like appearance and behavior of an object. It includes name, color, height, width etc. Events are actions applied to an object. Methods are responses according to an event.
          TV is an object. Its properties include model, color, shape, size, brand, price etc. Events include pressing volume button, pressing channel changing button, pressing power on/off button etc. Method includes increasing/decreasing volume when volume button pressed; change the channel when that button is pressed etc.
Building VB Applications
·        Open VB IDE
StartàAll ProgramsàMicrosoft Visualstudio6.0à Microsoft Visual Basic6.0
Select ‘Standard Exe’ project type from ‘new project’ window, then
·        Create user interface
·        Set properties
·        Write codes
·        Run and Debug
·        Save the form and project
Msgbox Function
          It is used to provide some information or message from the application program to the user.
Syntax
Msgbox “Messagetext”, Button specification, “Titlebartext”
Eg:- Msgbox “Hello welcome to VB”, vbokcancel, “Welcome Message”
Inputbox Function
          It is used to get some text input from user to the application program.
Syntax
Inputbox “Messagetext”, “Titlebartext”, “Defaulttext”
Eg:- Inputbox “Enter Student’s Score”, “Student Details”, “00”

No comments:

Post a Comment

 

Welcome Plus one ,How you rate IT Club SKHSS

Members

Contact Form

Name

Email *

Message *

Visitors Counter

Most Reading

SREEKRISHNA HIGHER SECONDARY SCHOOL- IT CLUB. Powered by Blogger.