module 3
module 3
module 3
Reserved keywords include Loop, If, Then, For, Select, End, Sub, Case, Function,
Integer, Else, Do, And, AndAlso, As, Boolean, ByRef, Byte, ByVal, Case, Cbool,
Cchar, Cdec, char, Cint, Cshort, CLng, CSng, CStr, Ctype, Decimal, Declare, Dim,
Do, Double, Each, Else, ElseIf, End, End If, Error, Event, Explicit, False, For, Get,
GetType, GoTo, If, Imports, Input, Integer, Is, Like, Long, Module, Mod, MyClass,
On, Off, OrElse, Private, Property, Public, Read, ReadOnly, Return, Short, Single,
Static, Step, Stop, Sub, Then, To, TypeOf, While
Subprograms in VB are known as Event Procedures/ Subroutines.
Procedures tells each object on your form how to react to something that the user
does.
F4 is to display property window, F5 to run VB, F7 to display code window. VB
stores the name of the object in a list called the Object list.
The common elements of a VB user interface include Forms known as windows, buttons such
as Command Button and Radio Buttons. Boxes such as Textboxes and CheckBoxes, Label,
Pictures as Icons and Graphics. Pointer is to select objects, Picture Box ( is to draw a box to
display graphics), Label (is to draw a box to display text), Textbox (is to draw a box that can
display text and let the user type in text). Frame( is to group 2 or more objects together).
Command Button( is to draw command button). Check Box(is to draw check box). Option or
radio button( is to draw radio button). Combo box (is to draw combo box) . List Box (is to draw
list box). Horizontal Scroll Bar (is to draw horizontal Scroll Bar). Vertical scroll bar (is to draw
vertical scroll bar). Timer is to place a timer on a form.
Lists of Standard window in VB
Code: shows the actual basic code behind a form.
Designer: is the view you’ll use to drag controls from the toolbox onto forms to build up
application’s user interface.
Database Explorer: show the tables stored procedures and other artifacts inside the
database.
Solution Explorer: shows all the files in the project. It shows every single project in the
solution and all the files in each project. It holds the filenames for the files included in
your project and a list of the classes it references.
Properties window: customize the look and feel and behaviour of the various
components of your program and its user interface. It is to set the properties for the
objects in your project. It is to customize those controls to give your application a
unique look and feel. Also, to provides options that relates to the code.
Toolbox: is a dynamic window in that its contents change based on what you are doing.
it holds the tools you use to place controls on a form. e.g all windows form, common
controls, menu and toolbar, data, component, printing, dialog, reporting, general.
Form designer: is where you design a form that makes up your user interface.
Toolbars: you can use the buttons on the toolbars as shortcuts for frequently used
operations. Each button represents a command that can also be selected from a menu.
Object Browser, Error List, Document Outline, Output, Tasklist, Start page, web Browser.
Opening New Dialog Box
Design View of Visual Basic
Starting Visual Studio.NET
Solution Explorer Windows
Toolbox windows
Properties windows
Creating New application
Creating Application
• Types of Applications
• Console Application – Usually Text only application. Runs from a DOS or
COMMAND PROMPT screen.
• Windows Application – Graphical Interface user application. Typical
Windows application that you normally use, such as MS WORD etc.
• Web Based Windows Application – Web application that uses a Browser
such as Internet Explorer, Mozilla Firefox, chrome etc.
Console Application
• A Console Application is a program whose output is usually text based
(No Graphics).
• Console Applications usually do not contain Forms or any graphics,
but they can. You can if you like from a console application call
Windows Forms etc.
• Console Applications are created when an application performs
processing that requires very or no user interaction.
• They are lighter and have less overhead than standard windows
applications since they contain no graphical libraries.
Console application contd
• Console applications are a good choice when creating programs such
as login scripts, device drivers, backend processes, test programs,
programs that control hardware devices etc.
• The results of a Console Application is placed or controlled from a
Command Prompt Window:
Console application contd
Windows Application
• Windows Applications are your standard graphical applications we are
used to using.
• Windows Apps use graphical entities such as Forms, Web Forms etc.
Windows Application contd
Web-Based Application
• These are applications created for the World-Wide-Web or Internet.
• These applications run from a Browser, but the actual program code
for these applications (HTML) reside on a Web
• Server and are distributed to any client or browser which makes the
request.
Web based application cont.
Creating VB.NETProject
• Steps in creating project
• Open the Visual Studio IDE and invoke the Start Page:
• In the Start Page, select New Project
• In the New Project Dialog select Application Type
• In the Project Types box select: “Visual Basic Projects”
• In the Template box select: “Windows Applications” or “Console Application”
• Enter the project name into the “Name:” text box
• Set the project path or location in the “Location:” text box. You can also
browse for the path using the “Browse” button.
• Click OK
Console Application
Main Screen for a Console
Application: