0% found this document useful (0 votes)
31 views23 pages

Topic 3-4

Uploaded by

brian.mwangi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views23 pages

Topic 3-4

Uploaded by

brian.mwangi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Programming Desktop

Applications
Topic 3
Objectives

 At the end of this topic, the learner should be able to:

I. Understand the features of IDE (Integrated Development Environment)


II. Comfortably navigate through the various windows and tools in Visual Studio.
III. Understand the different controls in the toolbox.
IV. Understand different types of applications in VB.net.
V. Understand the program structure
Integrated development environments
(IDE)
 Integrated development environments is a software platform that provide
programmers and developers a comprehensive set of tools for software
development in a single product. IDEs are built to work with specific
application platforms and remove barriers involved in the lifecycle of
software development. IDEs are used indevelopment teamsto build new
software, apps, web pages, and services, and they help by providing one tool
with all the features and removing the need for integrations. Compiling and
interpreting (Transferring to computer language)
Functions performed by the IDE

 Debugging (fixing run time or logic errors)


 Designing the user interface or application
 Writing codes
 Running the application
 Checking syntax (language) errors
 Intelligently completing code automatically
VB.NET

 VB.NET is also known as Visual Basic.NET. It stands for Visual Basic. Network
Enabled Technologies. It is a simple, high−level, object−oriented programming
language developed by Microsoft in 2002. It is a successor of Visual Basic 6.0,
which is implemented on the Microsoft .NET Framework. With this language,
you can develop a fully object− oriented application that is similar to an
application created through another language such as C++, Java, or C#.
Feature of VB.NET

 o Inheritance (object−oriented language)


 o Delegates and events
 o Parameterized constructors
 o Method overloading/overriding
 o Type−safe
 o Delegates and events
VB.Net IDE components

 The full name of IDE is an Integrated Development Environment. It is a


software application that allows developers to develop, run, test and debug
software.
 Generally, IDE consists of a code editor, a compiler, or an integrator and a
debugger.
Visual Studio
Parts of the IDE

 1. Title bar
 2. Menu bar
 3. Tool bar
 4. Toolbox
 5. Code window
 6. Solution explorer
 7. Properties window
 8. Output window
 9. Error list
 10. Form window
Toolbox

 The tool box contains the icon of the control we can place on a form to
create the application’s user interface. By default, tool box contains a pointer
icon and twenty other icon of ActiveX controls. The tool box appear at the
left side on screen by default. User can change its position anywhere on the
form.
 Even tool box can be turn off on screen. To place a control on a form, we
first select it with a mouse and then move the mouse over the form. When
the mouse is over the form, the curser turns into a large plus sign, and we can
draw control on the form, just as we would draw a circle using a drawing
application. The size of the circle determines the size of the control
Common Controls
TYPES OF APPLICATIONS IN VB.NET

 In VB.NET, you can develop different types of applications based on your


requirements and use cases. Here are some common types of applications
that can be developed using VB.NET:
 1. Console Applications: Console applications run in a command−line
interface, where users interact with the application by entering commands or
providing input through the keyboard. They are text−based and typically used
for tasks such as data processing, automation scripts, or command−line
utilities.
 2. Windows Forms Applications: Windows Forms applications, also known as
desktop applications, provide a graphical user interface (GUI) that runs on the
Windows operating system. These applications can include buttons,
textboxes, menus, and other controls to create interactive interfaces for
users.
VB.Net - Program Structure

 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
Hello World Program
The first line of the program Imports System is used to include the System namespace
in the program.
.object
The next line has a Module declaration, the module Module1. VB.Net is completely
oriented, so
every program must contain a module of a class that contains the data and procedures
that your program
uses.
Classes or Modules generally would contain more than one procedure. Procedures
contain the executable
code, or in other words, they define the behavior of the class. A procedure could be
any of the following −
 o Function
 o Sub
 o Operator
 o Get
 o Set
 o AddHandler
 o RemoveHandler
 o RaiseEvent
The next line( 'This program) will be ignored by the compiler and it has been put to
add additional comments in the program.
 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.

 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.

 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.
Creating A project
 Create A Project First, you'll create a Visual Basic app project. The default
project template includes all the files you'll need for a runnable app.
 Open Visual Studio.
 On the start window, choose Create a new project.
 In the Configure your new project window, enter WhatlsYourName in the
Project name box. Then, choose Next.

 In the Create a new project window, choose Visual Basic from the Language
list. Next, choose Windows from the Platform list and Console from the
Project types list.
 After you apply these language, platform, and project type filters, choose the
Console App template, and then choose Next
 In the Additional information window, .NET 8.0 (Long-term support) should
already be selected for your target framework. If not, select .NET 8.0 (Long-
… term support). Then, choose Create.
Run the App

 There are two ways to run this code, inside Visual Studio in debug mode, and
from your computer as a regular standalone app.

Run the app in debug mode:


 Select the WhatIsYourName button or press F5 to run the default code in
Debug mode.
 When the app runs in the Microsoft Visual Studio Debug Console, "Hello
World!" displays. Press any key to close the debug console window and end
the app:

You might also like