SlideShare a Scribd company logo
INTRODUCTION TO VB.NET
SUBTITLE
What is a Computer?
• A computer is a logical device for processing information.
• Specifically, computers process data.
• Data = structured information
• Base: Silicon VLSI technology
• VLSI = Very Large-Scale Integrated circuits
• Computers are Powerful!
• Can perform logical computations much faster than Humans.
• Current speed (desktop!): 4 x109 basic operations/sec (GHz)
• Each a simple logical operation (division, shift, write, etc.)
What is a Computer?
• Computers are Limited…
• Computation basically sequential…
• One operation at a time.
• In contrast, Humans use parallel processing ( by neurons).
• We are better at complex tasks (e.g., Vision, Pattern Recognition)
• Computers not very ‘adaptive’…
• Standard computers mainly do what they are told.
• Communication difficult (computers think logically):
• Programming languages (and programmers) required!
Software vs. Hardware
• At the most basic level computers can be broken down into
two components:
• Hardware and Software
• Hardware = the physical components of the computer
system.
• Data Processing: The Central Processing Unit (CPU)
• Data Storage: Memory storage devices:
• RAM (primary), Hard drive (secondary), flash disks (peripheral), etc.
• Data Communication: Devices for Input/Output:
• Input: Keyboard, mouse, etc.
• Output: Display, printer, speaker
Software vs. Hardware
• Software = the computer programs that run on a
computer
• These establish logical control over the hardware:
• Manage the details of Data Processing, Storage, and
Communication.
• The Operating System (OS): primary system control
• Windows, Ubuntu Linux, Mac OS X, Unix, etc.
• Application Software: MS-Word, PowerPoint, Excel, etc.
• User-built Applications: using a Programming Language
Programming Languages
• Many Programming Languages have been developed.
• Some well-known compiled High-Level Languages include (older to newer):
Programming Languages
• Many others, including interpreted languages: Python, Perl,
Ruby, etc.
• Languages allow communication between humans and
computers…
• This involves converting abstract algorithms for solving problems
into a form understandable by the computer.
• An ‘executable’ (i.e., run-able) form.
• Such a converted algorithm is called a program.
• The people that do the conversion (at the high level) are us…the
programmers.
Interpreted vs. Compiled Languages
• Before execution, instructions in a program must also be
converted:
• from a text file (human-readable words in a HLL)…
• …to an executable form (first to assembly, then to machine language)
• Two flavors exist for this conversion process:
• In advance (compiled all at once):
• Conversion by a program called a ‘compiler’.
• Faster, but less adaptable
• …better for Engineering.
• ‘On the fly’ (interpreted one instruction at a time):
• Conversion by a program called an ‘interpreter’.
• Slower, but programs may be changed at run-time
• …better for real-time Analysis and Management.
Interpreted vs. Compiled Languages
• Programming languages may be of either type...
• Interpreted: Python, Perl, bash scripting (Linux),
JavaScript
• Compiled: C, C++, C#, and VB .NET (visual basic)
• Some (JAVA, VB .NET, C#) are essentially a combination of
both:
Visual Basic vs. VB .NET
• BASIC
• Beginner’s All-purpose Symbolic Instruction Code
• Developed as an extension of C, to be a general-
purpose programming language.
• Visual BASIC (VB)
• BASIC + a Graphical User Interface (GUI)
• Greatly eases the creation of Windows applications
• Especially, by facilitating the use of re-usable components
Visual Basic vs. VB .NET
• Visual BASIC .NET
• A programming language based on VB 6.0
• Working on the .NET framework of the Microsoft
Corporation
• A Platform for cross-language development (C#, VB.
NET, C++, F#)
• Includes a large standard library called the BCL (Base
Class Library)
Visual Basic vs. VB .NET
• Visual Studio
• Microsoft’s Integrated Development Environment
(IDE) for VB .NET.
• Intended mainly for Windows Applications and
Web Applications.
• We will use Visual Studio 2010 to create all our
programs.
VB .NET
• Visual Basic (VB), originally called Visual Basic .NET (VB.NET), is a
multi-paradigm, object-oriented programming language,
implemented on .NET, and the .NET Framework.
• Microsoft launched VB.NET in 2002 as the successor to its original
Visual Basic language, the last version of which was Visual Basic 6.0.
• Microsoft updated its VB language strategy on 6 February 2023,
stating that VB is a stable language now and Microsoft will keep
maintaining it
CREATING A NEW PROJECT (VB.NET)
THE MAIN SCREEN
CODE EDITOR
Form and Controls Arrangement
Setting Control Properties
NAMING CONVENTION
OBJECT/TOOL SUGGESTED NAMES
TEXTBOX
txtName, txtAddress,
txt_Mobile
BUTTON
btnSave, btnCancel,
btn_Add
LABEL
lblSum, lblTotal,
lbl_name
Add a Slide Title - 3
Objects & Description
1
Forms
The container for all the controls that
make up the user interface.
2
TextBox
It represents a Windows text box
control.
3
Label
It represents a standard Windows
label.
4
Button
It represents a Windows button
control.
5
ListBox
It represents a Windows control to
display a list of items.
Objects & Description
6
ComboBox
It represents a Windows combo box
control.
7
RadioButton
It enables the user to select a single
option from a group of choices when
paired with other RadioButton controls.
8
CheckBox
It represents a Windows CheckBox.
9
PictureBox
It represents a Windows picture box
control for displaying an image.
10
ProgressBar
It represents a Windows progress bar
control.
Add a Slide Title - 3
Objects & Description
11
ScrollBar
It Implements the basic functionality of a scroll bar control.
12
DateTimePicker
It represents a Windows control that allows the user to
select a date and a time and to display the date and time
with a specified format.
13
TreeView
It displays a hierarchical collection of labeled items, each
represented by a TreeNode.
14
ListView
It represents a Windows list view control, which displays a
collection of items that can be displayed using one of four
different views.
11
ScrollBar
It Implements the basic functionality of a scroll bar control.
Object Properties
A PROPERTY is a value or characteristic held
by a Visual Basic object, such as Caption or
Fore Color. Properties can be set at design
time by using the Properties window or at run
time by using statements in the program code.
Object.
Object Events
An EVENT is a signal that informs an application
that something important has occurred. For
example, when a user clicks a control on a form,
the form can raise a Click event and call a
procedure that handles the event. Events also
allow separate tasks to communicate.
Form Properties
Once the Form is added to the
form, we can set various properties
of the Form by clicking on the
Form control.
Form Properties
No. Property & Description
1
Name
Sets the name of the Form.
2
Text
Sets the Title of the Form in the title bar.
3
Font
Gets or sets the font of the text displayed
by the Form.
4
ForeColor
Gets or sets the foreground color of the
Form.
5
BackColor
Sets the back color of the textbox
6
StartPosition
Sets the location of the form during
runtime.
7
Cursor
Change the cursor once focused on the
Form.
8
Enabled
Make the Form enabled or disabled
9
MinimizedBox
You can Hide or show the Minimize Button
of the form.
10
MaximizedBox
You can Hide or show the Maximize Button
of the form.
Form Properties
Properties can be set at design time by using the Properties window or
at run time by using statements in the program code.
Example
Form commonly used events
Event & Description
Load
Occurs when the Form is Running.
FormClosed
Occurs when the Form is closed.
Resize
Occurs when the Form is resized.
TextBox Properties
Once the TextBox is added to the
form, we can set various properties of
the TextBox by clicking on the TextBox
control.
TextBox Properties
No. Property & Description
1
Name
Sets the name of the Textbox.
2
Text
Sets the text of the TextBox
3
Font
Gets or sets the font of the text displayed
by the control.
4
ForeColor
Gets or sets the foreground color of the
control.
5
Multiline
Gets or sets a value indicating whether this
is a multiline TextBox control.
6
BackColor
Sets the back color of the textbox
7
Cursor
Change the cursor once focused on the
textbox.
8
Enabled
Make the textbox enabled or disabled
9
PasswordChar
Gets or sets the character used to mask
characters of a password in a single-line
TextBox control.
10
CharacterCasing
Gets or sets whether the TextBox control
modifies the case of characters as they are
typed.
TextBox Properties
Properties can be set at design time by using the Properties window or
at run time by using statements in the program code.
Example
TextBox commonly used events
Event & Description
Click
Occurs when the control is clicked.
DoubleClick
Occurs when the control is double-clicked.
TextChanged
Occurs when the TextAlign property value
changes.
TextBox commonly used events
Event & Description
Click
Occurs when the control is clicked.
DoubleClick
Occurs when the control is double-clicked.
TextChange
Occurs when the you type something in the
TextBox.
Button Properties
Once the Button is added to the form,
we can set various properties of the
Button by clicking on the Button
control.
Button Properties
No. Property & Description
1
Name
Sets the name of the Button.
2
Text
Sets the text of the Button
3
Font
Gets or sets the font of the text displayed
by the control.
4
ForeColor
Gets or sets the foreground color of the
control.
5
BackColor
Sets the back color of the textbox
6
Image
You can add an image of the Button
7
Cursor
Change the cursor once focused on the
textbox.
8
Enabled
Make the textbox enabled or disabled
9
TextAlign
Sets the alignment of the text inside the
Button
10
Visible
Sets the visibility of the Button
Button Properties
Properties can be set at design time by using the Properties window or
at run time by using statements in the program code.
Example
Button commonly used events
Event & Description
Click
Occurs when the control is clicked.
DoubleClick
Occurs when the control is double-
clicked.
RadioButton
Once the RadioButton is added to the
form, we can set various properties of
the RadioButton by clicking on the
RadioButton control.
RadioButton Properties
No. Property & Description
1
Name
Sets the name of the Button.
2
Text
Sets the text of the Button
3
Font
Gets or sets the font of the text displayed
by the control.
4
ForeColor
Gets or sets the foreground color of the
control.
5
BackColor
Sets the back color of the textbox
6
Image
You can add an image of the Button
7
Cursor
Change the cursor once focused on the
textbox.
8
Enabled
Make the textbox enabled or disabled
9
TextAlign
Sets the alignment of the text inside the
Button
10
Visible
Sets the visibility of the Button
RadioButton Properties
Properties can be set at design time by using the Properties window or
at run time by using statements in the program code.
Example
RadioButton commonly used events
Event & Description
CheckedChanged
Occurs when the control is
clicked.
CheckBox Properties
Once the CheckBox is added to the
form, we can set various properties of
the CheckBox by clicking on the
CheckBox control.
Note: You may explore the Checkbox
Properties on your laboratories
CheckBox Properties
Properties can be set at design time by using the Properties window or
at run time by using statements in the program code.
Example
Button commonly used events
Event & Description
ClickedChanged
Occurs when the control is
clicked.
VB Net Data Types
Type Storage Allocation Value Range
Boolean
Depends on
implementing
platform
True or False
Byte 1 byte 0 through 255 (unsigned)
Char 2 bytes 0 through 65535 (unsigned)
Date 8 bytes
0:00:00 (midnight) on January 1, 0001 through 11:59:59 PM
on December 31, 9999
Decimal 16 bytes
0 through +/-79,228,162,514,264,337,593,543,950,335 (+/-
7.9...E+28) with no decimal point; 0 through +/-
7.9228162514264337593543950335 with 28 places to the
right of the decimal
VB Net Data Types
Type Storage Allocation Value Range
Double 8 bytes
-1.79769313486231570E+308 through -
4.94065645841246544E-324, for negative values
4.94065645841246544E-324 through
1.79769313486231570E+308, for positive values
Integer 4 bytes -2,147,483,648 through 2,147,483,647 (signed)
Long 8 bytes
-9,223,372,036,854,775,808 through
9,223,372,036,854,775,807(signed)
Object
4 bytes on 32-
bit platform
8 bytes on 64-
bit platform
Any type can be stored in a variable of type
Object
SByte 1 byte -128 through 127 (signed)
VB Net Data Types
Type Storage Allocation Value Range
Short 2 bytes -32,768 through 32,767 (signed)
Single 4 bytes
-3.4028235E+38 through -1.401298E-45 for
negative values;
1.401298E-45 through 3.4028235E+38 for
positive values
String
Depends on
implementing
platform
0 to approximately 2 billion Unicode characters
UInteger 4 bytes 0 through 4,294,967,295 (unsigned)
ULong 8 bytes
0 through 18,446,744,073,709,551,615
(unsigned)
UShort 2 bytes 0 through 65,535 (unsigned)
VB Net Data Types Category
Type Example
Integral types
SByte, Byte, Short, UShort, Integer, UInteger,
Long, ULong and Char
Floating point
types
Single and Double
Decimal types Decimal
Boolean types True or False values, as assigned
Date types Date
VB Net Variables
A variable is nothing but a name given to a
storage area that our programs can
manipulate. Each variable in VB.Net has a
specific type, which determines the size and
layout of the variable's memory; the range
of values that can be stored within that
memory; and the set of operations that can
be applied to the variable.
Variable Initialization in VB.Net
Variables are initialized (assigned a value)
with an equal sign followed by a constant
expression. The general form of initialization
is
variable_name = value
Variable Declaration in VB.Net
The Dim statement is used for variable
declaration and storage allocation for one or
more variables. The Dim statement is used
at module, class, structure, procedure or
block level.
Dim pi As Double
pi = 3.14159
Variable Declaration in VB.Net
You can initialize a variable at the time of
declaration as follows
Dim StudID As Integer = 100
Dim StudName As String = "Bill Smith"
Variable Declaration in VB.Net
VB.Net - Arithmetic Operators
Following table shows all the arithmetic operators supported by
VB.Net. Assume variable A=2 and variable B=7, then
Operator Description Example
^ Raises one operand to the power of another B^A will give 49
+ Adds two operands A + B will give 9
- Subtracts second operand from the first A - B will give -5
* Multiplies both operands A * B will give 14
/
Divides one operand by another and returns
a floating point result
B / A will give 3.5

Divides one operand by another and returns
an integer result
B  A will give 3
MOD
Modulus Operator and remainder of after
an integer division
B MOD A will give 1
Variable Declaration in VB.Net

More Related Content

PPS
Vb6.0 Introduction
PPTX
Chapter 1
PPT
Compiler Design Basics
PPTX
UNIT - 1 VISUAL BASIC PRESENTATION FOR IT
PPT
Compiler Design Basics
PPT
Introduction to Compiler design
PDF
Introduction to Visual Basic 6.0
RTF
over all view programming to computer
Vb6.0 Introduction
Chapter 1
Compiler Design Basics
UNIT - 1 VISUAL BASIC PRESENTATION FOR IT
Compiler Design Basics
Introduction to Compiler design
Introduction to Visual Basic 6.0
over all view programming to computer

Similar to INTRODUCTION-TO-VB (2)-PROJECT POWERPOINT.pptx (20)

PDF
The Ring programming language version 1.6 book - Part 6 of 189
PDF
Integrating Xtext Language Server support in Visual Studio Code
PDF
Embedded systems designUNIT 4 PART 2.pdf
PPTX
.NET presentation
PDF
2 Programming Language.pdf
PDF
Chapter1pdf__2021_11_23_10_53_20.pdf
PDF
Compiler construction lecture 01 .pptx.pdf
PPT
Introduction to .Net
PPTX
DOT NET Framework.pptxdsfdsfdsfsdfdsfdsfdsf
PPT
DOCX
New microsoft office word document
DOCX
New microsoft office word document
DOCX
New microsoft office word document
PPTX
Basic Fundamentals Concept of Programming.pptx
PPT
Flex 4 Overview
PPTX
Welcome to the .Net
PPTX
Programming Paradigm & Languages
PPTX
Programming Paradigm & Languages
PPSX
Ic lecture8
The Ring programming language version 1.6 book - Part 6 of 189
Integrating Xtext Language Server support in Visual Studio Code
Embedded systems designUNIT 4 PART 2.pdf
.NET presentation
2 Programming Language.pdf
Chapter1pdf__2021_11_23_10_53_20.pdf
Compiler construction lecture 01 .pptx.pdf
Introduction to .Net
DOT NET Framework.pptxdsfdsfdsfsdfdsfdsfdsf
New microsoft office word document
New microsoft office word document
New microsoft office word document
Basic Fundamentals Concept of Programming.pptx
Flex 4 Overview
Welcome to the .Net
Programming Paradigm & Languages
Programming Paradigm & Languages
Ic lecture8
Ad

Recently uploaded (20)

PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
Pharma ospi slides which help in ospi learning
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Business Ethics Teaching Materials for college
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Basic Mud Logging Guide for educational purpose
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
TR - Agricultural Crops Production NC III.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Pharma ospi slides which help in ospi learning
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
102 student loan defaulters named and shamed – Is someone you know on the list?
Microbial disease of the cardiovascular and lymphatic systems
PPH.pptx obstetrics and gynecology in nursing
Business Ethics Teaching Materials for college
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
2.FourierTransform-ShortQuestionswithAnswers.pdf
VCE English Exam - Section C Student Revision Booklet
Anesthesia in Laparoscopic Surgery in India
Insiders guide to clinical Medicine.pdf
Renaissance Architecture: A Journey from Faith to Humanism
Basic Mud Logging Guide for educational purpose
Supply Chain Operations Speaking Notes -ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Ad

INTRODUCTION-TO-VB (2)-PROJECT POWERPOINT.pptx

  • 2. What is a Computer? • A computer is a logical device for processing information. • Specifically, computers process data. • Data = structured information • Base: Silicon VLSI technology • VLSI = Very Large-Scale Integrated circuits • Computers are Powerful! • Can perform logical computations much faster than Humans. • Current speed (desktop!): 4 x109 basic operations/sec (GHz) • Each a simple logical operation (division, shift, write, etc.)
  • 3. What is a Computer? • Computers are Limited… • Computation basically sequential… • One operation at a time. • In contrast, Humans use parallel processing ( by neurons). • We are better at complex tasks (e.g., Vision, Pattern Recognition) • Computers not very ‘adaptive’… • Standard computers mainly do what they are told. • Communication difficult (computers think logically): • Programming languages (and programmers) required!
  • 4. Software vs. Hardware • At the most basic level computers can be broken down into two components: • Hardware and Software • Hardware = the physical components of the computer system. • Data Processing: The Central Processing Unit (CPU) • Data Storage: Memory storage devices: • RAM (primary), Hard drive (secondary), flash disks (peripheral), etc. • Data Communication: Devices for Input/Output: • Input: Keyboard, mouse, etc. • Output: Display, printer, speaker
  • 5. Software vs. Hardware • Software = the computer programs that run on a computer • These establish logical control over the hardware: • Manage the details of Data Processing, Storage, and Communication. • The Operating System (OS): primary system control • Windows, Ubuntu Linux, Mac OS X, Unix, etc. • Application Software: MS-Word, PowerPoint, Excel, etc. • User-built Applications: using a Programming Language
  • 6. Programming Languages • Many Programming Languages have been developed. • Some well-known compiled High-Level Languages include (older to newer):
  • 7. Programming Languages • Many others, including interpreted languages: Python, Perl, Ruby, etc. • Languages allow communication between humans and computers… • This involves converting abstract algorithms for solving problems into a form understandable by the computer. • An ‘executable’ (i.e., run-able) form. • Such a converted algorithm is called a program. • The people that do the conversion (at the high level) are us…the programmers.
  • 8. Interpreted vs. Compiled Languages • Before execution, instructions in a program must also be converted: • from a text file (human-readable words in a HLL)… • …to an executable form (first to assembly, then to machine language) • Two flavors exist for this conversion process: • In advance (compiled all at once): • Conversion by a program called a ‘compiler’. • Faster, but less adaptable • …better for Engineering. • ‘On the fly’ (interpreted one instruction at a time): • Conversion by a program called an ‘interpreter’. • Slower, but programs may be changed at run-time • …better for real-time Analysis and Management.
  • 9. Interpreted vs. Compiled Languages • Programming languages may be of either type... • Interpreted: Python, Perl, bash scripting (Linux), JavaScript • Compiled: C, C++, C#, and VB .NET (visual basic) • Some (JAVA, VB .NET, C#) are essentially a combination of both:
  • 10. Visual Basic vs. VB .NET • BASIC • Beginner’s All-purpose Symbolic Instruction Code • Developed as an extension of C, to be a general- purpose programming language. • Visual BASIC (VB) • BASIC + a Graphical User Interface (GUI) • Greatly eases the creation of Windows applications • Especially, by facilitating the use of re-usable components
  • 11. Visual Basic vs. VB .NET • Visual BASIC .NET • A programming language based on VB 6.0 • Working on the .NET framework of the Microsoft Corporation • A Platform for cross-language development (C#, VB. NET, C++, F#) • Includes a large standard library called the BCL (Base Class Library)
  • 12. Visual Basic vs. VB .NET • Visual Studio • Microsoft’s Integrated Development Environment (IDE) for VB .NET. • Intended mainly for Windows Applications and Web Applications. • We will use Visual Studio 2010 to create all our programs.
  • 13. VB .NET • Visual Basic (VB), originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, and the .NET Framework. • Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language, the last version of which was Visual Basic 6.0. • Microsoft updated its VB language strategy on 6 February 2023, stating that VB is a stable language now and Microsoft will keep maintaining it
  • 14. CREATING A NEW PROJECT (VB.NET)
  • 17. Form and Controls Arrangement
  • 19. NAMING CONVENTION OBJECT/TOOL SUGGESTED NAMES TEXTBOX txtName, txtAddress, txt_Mobile BUTTON btnSave, btnCancel, btn_Add LABEL lblSum, lblTotal, lbl_name
  • 20. Add a Slide Title - 3 Objects & Description 1 Forms The container for all the controls that make up the user interface. 2 TextBox It represents a Windows text box control. 3 Label It represents a standard Windows label. 4 Button It represents a Windows button control. 5 ListBox It represents a Windows control to display a list of items. Objects & Description 6 ComboBox It represents a Windows combo box control. 7 RadioButton It enables the user to select a single option from a group of choices when paired with other RadioButton controls. 8 CheckBox It represents a Windows CheckBox. 9 PictureBox It represents a Windows picture box control for displaying an image. 10 ProgressBar It represents a Windows progress bar control.
  • 21. Add a Slide Title - 3 Objects & Description 11 ScrollBar It Implements the basic functionality of a scroll bar control. 12 DateTimePicker It represents a Windows control that allows the user to select a date and a time and to display the date and time with a specified format. 13 TreeView It displays a hierarchical collection of labeled items, each represented by a TreeNode. 14 ListView It represents a Windows list view control, which displays a collection of items that can be displayed using one of four different views. 11 ScrollBar It Implements the basic functionality of a scroll bar control.
  • 22. Object Properties A PROPERTY is a value or characteristic held by a Visual Basic object, such as Caption or Fore Color. Properties can be set at design time by using the Properties window or at run time by using statements in the program code. Object.
  • 23. Object Events An EVENT is a signal that informs an application that something important has occurred. For example, when a user clicks a control on a form, the form can raise a Click event and call a procedure that handles the event. Events also allow separate tasks to communicate.
  • 24. Form Properties Once the Form is added to the form, we can set various properties of the Form by clicking on the Form control.
  • 25. Form Properties No. Property & Description 1 Name Sets the name of the Form. 2 Text Sets the Title of the Form in the title bar. 3 Font Gets or sets the font of the text displayed by the Form. 4 ForeColor Gets or sets the foreground color of the Form. 5 BackColor Sets the back color of the textbox 6 StartPosition Sets the location of the form during runtime. 7 Cursor Change the cursor once focused on the Form. 8 Enabled Make the Form enabled or disabled 9 MinimizedBox You can Hide or show the Minimize Button of the form. 10 MaximizedBox You can Hide or show the Maximize Button of the form.
  • 26. Form Properties Properties can be set at design time by using the Properties window or at run time by using statements in the program code. Example
  • 27. Form commonly used events Event & Description Load Occurs when the Form is Running. FormClosed Occurs when the Form is closed. Resize Occurs when the Form is resized.
  • 28. TextBox Properties Once the TextBox is added to the form, we can set various properties of the TextBox by clicking on the TextBox control.
  • 29. TextBox Properties No. Property & Description 1 Name Sets the name of the Textbox. 2 Text Sets the text of the TextBox 3 Font Gets or sets the font of the text displayed by the control. 4 ForeColor Gets or sets the foreground color of the control. 5 Multiline Gets or sets a value indicating whether this is a multiline TextBox control. 6 BackColor Sets the back color of the textbox 7 Cursor Change the cursor once focused on the textbox. 8 Enabled Make the textbox enabled or disabled 9 PasswordChar Gets or sets the character used to mask characters of a password in a single-line TextBox control. 10 CharacterCasing Gets or sets whether the TextBox control modifies the case of characters as they are typed.
  • 30. TextBox Properties Properties can be set at design time by using the Properties window or at run time by using statements in the program code. Example
  • 31. TextBox commonly used events Event & Description Click Occurs when the control is clicked. DoubleClick Occurs when the control is double-clicked. TextChanged Occurs when the TextAlign property value changes.
  • 32. TextBox commonly used events Event & Description Click Occurs when the control is clicked. DoubleClick Occurs when the control is double-clicked. TextChange Occurs when the you type something in the TextBox.
  • 33. Button Properties Once the Button is added to the form, we can set various properties of the Button by clicking on the Button control.
  • 34. Button Properties No. Property & Description 1 Name Sets the name of the Button. 2 Text Sets the text of the Button 3 Font Gets or sets the font of the text displayed by the control. 4 ForeColor Gets or sets the foreground color of the control. 5 BackColor Sets the back color of the textbox 6 Image You can add an image of the Button 7 Cursor Change the cursor once focused on the textbox. 8 Enabled Make the textbox enabled or disabled 9 TextAlign Sets the alignment of the text inside the Button 10 Visible Sets the visibility of the Button
  • 35. Button Properties Properties can be set at design time by using the Properties window or at run time by using statements in the program code. Example
  • 36. Button commonly used events Event & Description Click Occurs when the control is clicked. DoubleClick Occurs when the control is double- clicked.
  • 37. RadioButton Once the RadioButton is added to the form, we can set various properties of the RadioButton by clicking on the RadioButton control.
  • 38. RadioButton Properties No. Property & Description 1 Name Sets the name of the Button. 2 Text Sets the text of the Button 3 Font Gets or sets the font of the text displayed by the control. 4 ForeColor Gets or sets the foreground color of the control. 5 BackColor Sets the back color of the textbox 6 Image You can add an image of the Button 7 Cursor Change the cursor once focused on the textbox. 8 Enabled Make the textbox enabled or disabled 9 TextAlign Sets the alignment of the text inside the Button 10 Visible Sets the visibility of the Button
  • 39. RadioButton Properties Properties can be set at design time by using the Properties window or at run time by using statements in the program code. Example
  • 40. RadioButton commonly used events Event & Description CheckedChanged Occurs when the control is clicked.
  • 41. CheckBox Properties Once the CheckBox is added to the form, we can set various properties of the CheckBox by clicking on the CheckBox control. Note: You may explore the Checkbox Properties on your laboratories
  • 42. CheckBox Properties Properties can be set at design time by using the Properties window or at run time by using statements in the program code. Example
  • 43. Button commonly used events Event & Description ClickedChanged Occurs when the control is clicked.
  • 44. VB Net Data Types Type Storage Allocation Value Range Boolean Depends on implementing platform True or False Byte 1 byte 0 through 255 (unsigned) Char 2 bytes 0 through 65535 (unsigned) Date 8 bytes 0:00:00 (midnight) on January 1, 0001 through 11:59:59 PM on December 31, 9999 Decimal 16 bytes 0 through +/-79,228,162,514,264,337,593,543,950,335 (+/- 7.9...E+28) with no decimal point; 0 through +/- 7.9228162514264337593543950335 with 28 places to the right of the decimal
  • 45. VB Net Data Types Type Storage Allocation Value Range Double 8 bytes -1.79769313486231570E+308 through - 4.94065645841246544E-324, for negative values 4.94065645841246544E-324 through 1.79769313486231570E+308, for positive values Integer 4 bytes -2,147,483,648 through 2,147,483,647 (signed) Long 8 bytes -9,223,372,036,854,775,808 through 9,223,372,036,854,775,807(signed) Object 4 bytes on 32- bit platform 8 bytes on 64- bit platform Any type can be stored in a variable of type Object SByte 1 byte -128 through 127 (signed)
  • 46. VB Net Data Types Type Storage Allocation Value Range Short 2 bytes -32,768 through 32,767 (signed) Single 4 bytes -3.4028235E+38 through -1.401298E-45 for negative values; 1.401298E-45 through 3.4028235E+38 for positive values String Depends on implementing platform 0 to approximately 2 billion Unicode characters UInteger 4 bytes 0 through 4,294,967,295 (unsigned) ULong 8 bytes 0 through 18,446,744,073,709,551,615 (unsigned) UShort 2 bytes 0 through 65,535 (unsigned)
  • 47. VB Net Data Types Category Type Example Integral types SByte, Byte, Short, UShort, Integer, UInteger, Long, ULong and Char Floating point types Single and Double Decimal types Decimal Boolean types True or False values, as assigned Date types Date
  • 48. VB Net Variables A variable is nothing but a name given to a storage area that our programs can manipulate. Each variable in VB.Net has a specific type, which determines the size and layout of the variable's memory; the range of values that can be stored within that memory; and the set of operations that can be applied to the variable.
  • 49. Variable Initialization in VB.Net Variables are initialized (assigned a value) with an equal sign followed by a constant expression. The general form of initialization is variable_name = value
  • 50. Variable Declaration in VB.Net The Dim statement is used for variable declaration and storage allocation for one or more variables. The Dim statement is used at module, class, structure, procedure or block level. Dim pi As Double pi = 3.14159
  • 51. Variable Declaration in VB.Net You can initialize a variable at the time of declaration as follows Dim StudID As Integer = 100 Dim StudName As String = "Bill Smith"
  • 53. VB.Net - Arithmetic Operators Following table shows all the arithmetic operators supported by VB.Net. Assume variable A=2 and variable B=7, then Operator Description Example ^ Raises one operand to the power of another B^A will give 49 + Adds two operands A + B will give 9 - Subtracts second operand from the first A - B will give -5 * Multiplies both operands A * B will give 14 / Divides one operand by another and returns a floating point result B / A will give 3.5 Divides one operand by another and returns an integer result B A will give 3 MOD Modulus Operator and remainder of after an integer division B MOD A will give 1