0% found this document useful (0 votes)
17 views

Introduction To Visual Basic

Uploaded by

joannarazalan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Introduction To Visual Basic

Uploaded by

joannarazalan
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

INTRODUCTION TO

VISUAL BASIC
Mrs. Algin B. Jacinto
VISUAL BASIC.NET
• VB.NET stands for Visual Basic.NET
• it is a computer programming language developed by
Microsoft.
• It was first released in 2002 to replace Visual Basic 6.
VB.NET 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 VB.NET 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.
VB.NET - 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
• VB.NET 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
VB.NET 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 VB.Net. 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
VB.NET

• Microsoft provides the following development tools


for VB.Net programming
•• Visual Studio (VS)
•• Visual Basic Express (VBE)
•• Visual Web Developer
HISTORY OF VB.NET
• VB.NET is a multi-paradigm programming
language developed by Microsoft on the .NET
framework.
• 2002
• In 2003, the second version of VB.NET,
VB.NET 7.1, was released. This one relied
on .NET version 1.1.
• In 2005, VB.NET 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
VB.NET 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 VB.NET 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 VB.NET 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.
VB.NET FEATURES
• VB.NET 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
VB.NET application.
• Windows Forms- you can inherit your
form from an already existing form.
ADVANTAGES OF VB.NET
• 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 VB.NET

• VB.NET is easy to learn. This has led to a large


talent pool. Hence, it may be challenging to
secure a job as a VB.NET programmer.
• VB.NET 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:
• VB.NET was developed by Microsoft.
• It is an object-oriented language.
• The language is not case sensitive.
• VB.NET programs run on the .NET framework.
• In VB.NET, the garbage collection process has been
automated.
• The language provides windows forms from which you
can inherit your own forms.
• VB.NET allows you to enjoy the drag and drop feature
when creating a user interface.
VB.NET - PROGRAM STRUCTURE
• A VB.Net 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()
Console.WriteLine(“Hello, World!”)
Console.ReadKey()
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()
Console.WriteLine("Hello World")
Console.ReadKey()
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()
Console.WriteLine("Hello World")
Console.ReadKey()
End Sub
End Module

The next line has a Module declaration, the module


Module1. VB.Net 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()
Console.WriteLine("Hello World")
Console.ReadKey()
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()
Console.WriteLine("Hello World")
Console.ReadKey()
End Sub
End Module

The next line defines the Main procedure, which is


the entry point for all VB.Net 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()
Console.WriteLine("Hello World")
Console.ReadKey()
End Sub
End Module

The Main procedure specifies its behavior with the statement


Console.WriteLine("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()
Console.WriteLine("Hello World")
Console.ReadKey()
End Sub
End Module

The last line Console.ReadKey() is for the VS.NET


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()
Console.WriteLine("Hello World")
Console.ReadKey()
End Sub
End Module
Imports System
Module Module1
'This program will display Hello World
Sub Main()
Console.WriteLine("Hello World")
Console.ReadKey()
End Sub
End Module

You might also like