LECTURE 1
Introduction
Visual Basic is a high-level language produced by Microsoft in 1991 as the first
programming language that directly supported graphical user interfaces. From that time until now,
there were many other versions released, each version having features that increased the power of
the language. Visual Basic can be used within Visual Studio to develop various applications
Visual Studio
Visual Studio is an integrated development environment (IDE) developed by Microsoft.
It provides a comprehensive platform for developers to design, code, test, and deploy various types
of applications, including Window, web, mobile, and cloud-based applications. Visual studio
supports multiple programming languages, including C++, C#, Python, .NET and more.
Visual Studio 2022
Visual Studio 2022 is the latest major release of the premier development environment
from Microsoft. It is powerful computer program that helps students to create, design and develop
amazing software applications. To install the Visual basic 2022, you need an internet and Visual
Studio Installer.
Visual Studio Installer
The installer for each edition can be downloaded from the Visual Studio website and is
called VisualStudioInstaller.exe. Like its predecessor, Visual Studio 2022 is available in the
following editions: Community, Professional and Enterprise. For the Professional and
Enterprise editions, the installer offers a free trial, but you will be able to unlock the appropriate
subscription level when you sign into Visual Studio with your Microsoft account. Therefore, a
community edition is recommended for teachers and students. This is because, it is free for
students, Open-source contributors and individuals.
Installing Visual Studio 2022
The Visual studio 2022 can be install using the installation program for Visual Studio
called Visual studio installer by following these steps:
• Step 1: Run the VisualStudioSetup.exe file shown in figure 1, the installation process will
begin
Figure 1: Visual Studio Installer
• Step 2: Click continue.
Figure 2: Installation continue
• Step 3: Wait as Installation is in progress
Figure 3: Installation in progress
• Step 4: Choose the workload you want install (Select .Net desktop development as shown
in Figure 4). Click next to continue.
Figure 4: Selecting Workloads in Visual Studio Installer
• Step 5: Wait for the installation to complete as shown in figure 5. The installation process
may take several minutes to complete.
Figure 5: Installing Visual Studio 2022
• Step 6: Once the installation is complete click ‘Launch’ to start Visual studio 2022 as
shown in Figure 6.
Figure 6: Installed Visual Studio
Affter launching the Visual studio 2022, you can now start Creating a project usig the
Visual basic. Visual basic is both a programming language and integrated Development
Environment (IDE). This means that instead of writing thousands of lines of codes, you can create
complicated programs by stringing together different forms and components. The end result is a
refreshingly simple, fun and easy to use approach to programming that is great for beginners as
well as advanced coders.
Figure 7: Launching Visual Studio 2022
LECTURE 2
Creating New Project in Visual Studio 2022
Visual Studio Community edition is a streamlined version of Visual Studio, specially
created for those people learning programming. It has a simplified user interface and omits
advanced features of the professional edition to avoid confusion. Within its IDE, code can be
written in the Visual Basic programming language to create Windows applications. In order to
create Windows applications with the Visual Basic programming language, you will first need to
create new project. You can create new project in Visual studio 2022 by following these steps:
• Step 1: Open Visual Studio 2022 Click on ‘ceate a new project’ as shown in Figure 8
Figure 8: Creating Project in Visual Studio 2022
• Step 2: Set the Visual Studio Template (Studio provides templates that help you make
desktop apps, mobile apps, websites, games, etc.). Select Visual Basic, Window and
Desktop as shown in Figure 9. Click next to proceed.
Figure 9: Setting the Template in Visual Studio 2022
• Step 3: You can configure your new project by changing the project name, location and
solution as shown in Figure 10. Click next to proceed.
Figure 10: Configure new Project
• Step 4: Set the additional information by selecting ‘.NET 8.0 (Long Term Support)’ as
shown in Figure 11. Click create.
Figure 11: Setting the additional information
• Step 5: Once the new project is created the integrated Development Environment (IDE)
will appear as shown in Figure 12. Microsoft Visual Studio is the professional development
tool that provides a fully Integrated Development Environment for Visual Basic. Within
its IDE, code can be written to create Windows applications.
Figure 12: Project design Window
LECTURE 3
Integrated development environment (IDE)
Visual Basic allows the programmer to use tools to accomplish a program’s goal. Programs
written for the Windows environment typically use tools such as labels, check boxes, list boxes,
and buttons. The Visual Studio integrated development environment (IDE) is an environment that
contains all of the tools and features you need to create, run, and test your programs. You also will
use the IDE to create graphical user interfaces for your programs. A graphical user interface (GUI)
is what the user sees and interacts with while your program is running. The user interface and its
program instructions are referred to as an application. The Visual Studio IDE contains many
different windows, each with its own special purpose. The main windows you will use most often
when designing your user interfaces are shown in Figure 13.
Menu bar Tool bar
Solution
Explorer
Project
designer
Window Properties
Window
Tool box
Form
Figure 13: The IDE
Designer window and Form: The designer window is where you design your application’s GUI.
A Windows Form object, or form, appears in the designer window shown in Figure 13. A form is
the foundation for the user interface in an application created for the Windows environment. The
form is automatically instantiated for you when you create a Windows Forms application in Visual
Basic.
Toolbox: You use the Toolbox window to add other objects, called controls (tools), to the form.
You add a tool by clicking its corresponding tool picture in the toolbox and then dragging it with
your mouse pointer to the form. For example, the button object shown in Figure 14 was instantiated
(created) by dragging the Button tool from the toolbox to the form.
Figure 14: Tool box open in the IDE
Properties window: Each tool has a set of attributes that determine its appearance and behavior.
The attributes, called properties, are listed in the Properties window when the tool is selected in
the designer window. In Figure 15, the form is selected, and the names of its properties (such as
BackColor and Text), along with their values (Control and Form1), appear in the Properties
window. You can use the Properties window to change the value of a tool’s property. For example,
you can use it to change the form’s Text property, which appears in the form’s title bar, from
Form1 to Practical1.
Figure 15: Properties window open in the IDE
Solution Explorer window: Windows applications in Visual Basic are composed of solutions,
projects, and files. A solution is a container that stores the projects and files for an entire
application. A project is also a container, but it stores only the files associated with that particular
project. The Solution Explorer window shown in figure 16 displays a list of the projects contained
in the current solution and the items contained in each project.
Figure 16: Solution Explorer window open in the IDE
Code Editor window: Code Editor window appears as soon as you click on any tool inside the
form or click on the form itself. You can enter the code in the Code Editor window as shown in
Figure 17..
Figure 17: Code Editor window open in the IDE