INTRODUCTION TO
VISUAL BASIC
Mrs. Algin B. Jacinto
VISUAL [Link]
• [Link] stands for Visual [Link]
• it is a computer programming language developed by
Microsoft.
• It was first released in 2002 to replace Visual Basic 6.
[Link] is an object-oriented programming language.
• It is an object-oriented computer programming
language implemented on the .NET Framework
• Not compatible with Visual Basic 6
THE FOLLOWING REASONS MAKE [Link] A WIDELY
USED PROFESSIONAL LANGUAGE
•• Modern, general purpose.
•• Object oriented.
•• Component oriented.
•• Easy to learn.
•• Structured language.
•• It produces efficient programs.
•• It can be compiled on a variety of computer platforms.
•• Part of .Net Framework.
[Link] - ENVIRONMENT
SETUP
• The .Net Framework
• The .Net framework is a revolutionary platform
that helps you to write the following types of
applications
•• Windows applications
•• Web applications
•• Web services
.NET FRAMEWORK
• [Link] is implemented by Microsoft's .NET
framework. It has full access to all the libraries in
the .Net Framework. It's also possible to run
[Link] programs on Mono, the open-source
alternative to .NET, not only under Windows, but
even Linux or Mac OSX.
• The .Net framework consists of an enormous library of
codes used by the client languages like [Link]. These
languages use object-oriented methodology.
• Following are some of the components of the .Net
framework
- Common Language Runtime (CLR)
- The .Net Framework Class Library
- Common Language Specification
- Common Type System
- Metadata and Assemblies
- Windows Forms
INTEGRATED DEVELOPMENT ENVIRONMENT (IDE) FOR
[Link]
• Microsoft provides the following development tools
for [Link] programming
•• Visual Studio (VS)
•• Visual Basic Express (VBE)
•• Visual Web Developer
HISTORY OF [Link]
• [Link] is a multi-paradigm programming
language developed by Microsoft on the .NET
framework.
• 2002
• In 2003, the second version of [Link],
[Link] 7.1, was released. This one relied
on .NET version 1.1.
• In 2005, [Link] 8.0 was released. The .NET core portion
was dropped from its This version was named Visual Basic
2005. Some of the features introduced by this version of
[Link] included partial classes, generics, nullable types,
operator overloading, and unsigned integer support. This
version also saw the introduction of the IsNot operator.
• In 2008, VB 9.0 was introduced. This was released
together with .NET 3.5. Some of the features added to this
release of [Link] included anonymous types, true
conditional operator, LINQ support, XML literals, Lambda
expressions, extension methods, and type inference.
• In 2010, Microsoft released VB 2010 (code 10.0). They
wanted to use a Dynamic Language Runtime for this
release, but they opted for co-evolution strategy shared
between [Link] and C# to bring these languages closer
to each other.
• In 2012, VB 2012 (code 11.0) was release together
with .NET 4.5. Its features included call hierarchy,
iterators, caller data, asynchronous programming with
“await” and “async” statements and the “Global”
keyword in the “namespace” statements.
• In 2015, VB 2015 (code 14.0) was released
alongside Visual Studio 2015. The “?.” operator
was introduced to do inline null checks. A string
interpolation feature was also introduced to help
in formatting strings inline.
• In 2017, VB 2017 (code 15.0) was introduced
alongside Visual Studio 2017. A better way of
organizing source code in just a single action was
introduced.
[Link] FEATURES
• [Link] is not case sensitive
• It is an object-oriented programming
language. It treats everything as an object.
• Garbage collection is automated.
• Support for Boolean conditions for decision
making.
• Simple multithreading, allowing your apps to
deal with multiple tasks simultaneously.
• Simple generics.
• A standard library.
• Events management.
• References. You should reference an
external object that is to be used in a
[Link] application.
• Windows Forms- you can inherit your
form from an already existing form.
ADVANTAGES OF [Link]
• Your code will be formatted automatically.
• You will use object-oriented constructs to create an enterprise-
class code.
• You can create web applications with modern features like
performance counters, event logs, and file system.
• You can create your web forms with much ease through the
visual forms designer. You will also enjoy drag and drop
capability to replace any elements that you may need.
• You can connect your applications to other applications created
in languages that run on the .NET framework.
• You will enjoy features like docking, automatic control
anchoring, and in-place menu editor all good for developing
web applications.
DISADVANTAGES OF [Link]
• [Link] is easy to learn. This has led to a large
talent pool. Hence, it may be challenging to
secure a job as a [Link] programmer.
• [Link] cannot handle pointers directly. This is a
significant disadvantage since pointers are much
necessary for programming. Any additional coding
will lead to many CPU cycles, requiring more
processing time. Your application will become
slow.
SUMMARY:
• [Link] was developed by Microsoft.
• It is an object-oriented language.
• The language is not case sensitive.
• [Link] programs run on the .NET framework.
• In [Link], the garbage collection process has been
automated.
• The language provides windows forms from which you
can inherit your own forms.
• [Link] allows you to enjoy the drag and drop feature
when creating a user interface.
[Link] - PROGRAM STRUCTURE
• A [Link] program basically consists of the following parts
−
•• Namespace declaration
•• A class or module
•• One or more procedures
•• Variables
•• The Main procedure
•• Statements & Expressions
•• Comments
Let us look at a simple code that would print the words
"hello world"
Imports System
Module Module1
'This program will display Hello World
Sub Main()
[Link](“Hello, World!”)
[Link]()
End Sub
End Module
• When the above code is compiled and
executed, it produces the following result −
Hello,
World!
LET US LOOK VARIOUS PARTS OF THE BELOW
PROGRAM
Imports System
Module Module1
'This program will display Hello World
Sub Main()
[Link]("Hello World")
[Link]()
End Sub
End Module
The first line of the program Imports System is
used to include the System namespace in the
program.
Imports System
Module Module1
'This program will display Hello World
Sub Main()
[Link]("Hello World")
[Link]()
End Sub
End Module
The next line has a Module declaration, the module
Module1. [Link] is completely object oriented, so every
program must contain a module of a class that contains
the data and procedures that your program uses.
Imports System
Module Module1
'This program will display Hello World
Sub Main()
[Link]("Hello World")
[Link]()
End Sub
End Module
The next line( 'This program) will be ignored by
the compiler and it has been put to add
additional comments in the program.
Imports System
Module Module1
'This program will display Hello World
Sub Main()
[Link]("Hello World")
[Link]()
End Sub
End Module
The next line defines the Main procedure, which is
the entry point for all [Link] programs. The Main
procedure states what the module or class will do
when executed.
Imports System
Module Module1
'This program will display Hello World
Sub Main()
[Link]("Hello World")
[Link]()
End Sub
End Module
The Main procedure specifies its behavior with the statement
[Link]("Hello World") WriteLine is a method of the
Console class defined in the System namespace. This statement
causes the message "Hello, World!" to be displayed on the screen.
Imports System
Module Module1
'This program will display Hello World
Sub Main()
[Link]("Hello World")
[Link]()
End Sub
End Module
The last line [Link]() is for the [Link]
Users. This will prevent the screen from running and
closing quickly when the program is launched from
Visual Studio .NET.
Imports System
Module Module1
'This program will display Hello World
Sub Main()
[Link]("Hello World")
[Link]()
End Sub
End Module
Imports System
Module Module1
'This program will display Hello World
Sub Main()
[Link]("Hello World")
[Link]()
End Sub
End Module