Programming in Visual
Studio.NET
By
Dr. Salamudeen Alhassan
Content Overview
Introduction
◦ .Net Framework
◦ Object-Oriented Programming
Visual Studio
◦ IDE
◦ New Project
◦ Solution Explorer
◦ Toolbox
◦ Editors and Designers
◦ Properties window
◦ Build and Debug Tools
Introduction
.NET Framework
It is a software that runs primarily on
Microsoft Windows.
It includes a large library and supports
several programming languages with
allow language interoperability.
The .NET library is available to all the
programming languages that .NET
supports.
.NET Framework
Programs written for the .NET Framework
execute in a software environment, known
as the Common Language Runtime (CLR),
an application virtual machine that provides
important services such as security,
memory management, and exception
handling.
The class library and the CLR together
constitute the .NET Framework.
The latest version is .NET Framework 4.8
Object-Oriented Programming
It is a programming language model
organized around “objects” rather than
“actions” and data rather than logic.
Important features with OOP are:
◦ Classes and Objects
◦ Inheritance
◦ Polymorphism
◦ Encapsulation
Examples of OOP languages:
◦ Java, Python, C++, Visual Basic.NET, C#
Visual Studio
Microsoft Visual Studio is an integrated
development environment (IDE) from Microsoft.
It can be used to develop console and graphical
user interface applications along with Windows
Forms applications, web sites, web applications,
and web services in both native code together
with managed code for all platforms supported
by Microsoft Windows, Windows Phone, Windows
CE, .NET Framework, .NET Compact Framework
and Microsoft Silverlight.
Latest version is Visual studio 2019
Visual Studio
New Project
From the start Menu
From the File Menu
The most common applications are:
◦ Windows Form Application
◦ Console Application
◦ WPF Application
◦ ASP.NET Web Application
◦ Silverlight Application
Solution Explorer
Solutions and projects contain items that
represent the references, data connections,
folders, and files that you need to create
your application.
A solution container can contain multiple
projects and a project container typically
contains multiple items.
Toolbox
TheToolbox contains all the
necessary controls, etc. you need to
create your user interface.
Editors and Designers
Visual Studio has different editors and design
tools.
Graphical User Interface Designer
Code Editor
Properties window
Each control we have on our user interface
has lots of Properties we can set.
Build and Debug Tools
In Visual Studio we have lots of Build and
Debugging Tools.
Build Menu
◦ The most used tool is Build Solution
Debug menu
◦ The most used tool is Start Debugging
Visual Basic.Net
4th Generation Programming Environment /
Development Language
Based on BASIC language
Beginners All-Purpose Symbolic Instructional Code
Most widely used tool for developing
Windows Applications
Graphical User Interface (GUI)
Menus, Buttons, Icons to help the user
Full Object-Oriented Programming Language
How a VB Application is Compiled
and Run
Visual Studio .NET .NET Framework
Integrated Common
Visual Basic
Development Language
compiler
Environment Runtime
1 2 3
Solution Assembly
Project
Intermediate Language (IL)
Source files
Class references
Project and Solution Concepts
User creates a new project in Visual Studio
◦ A solution and a folder are created at the same time with the same
name as the project
◦ The project belongs to the solution
◦ Multiple projects can be included in a solution
Solution
◦ Contains several folders that define an application’s structure
◦ Solution files have a file suffix of .sln
Project: contains files for a part of the solution
◦ Project file is used to create an executable application
◦ A project file has a suffix of .vbproj
◦ Every project has a type (Console, Windows, etc.)
◦ Every project has an entry point: A Sub procedure named Main or
a Form
Project and Solution Folders/Files
Solution folder
◦ Solution file (.sln)
◦ Project folder
Project file (.vbproj)
Visual Basic source files (.vb)
My Project folder: contains configuration information
common to all projects
The file AssemblyInfo.vb contains assembly metadata
The References folder contains references to other
assemblies
The bin folder contains the executable file produced as
a result of compiling the application
Example 1
The Wage Calculator
◦ Design a program in VB.NET to compute the Gross
Pay earned by a worker given the Hours worked and
hourly pay rate.