Beruflich Dokumente
Kultur Dokumente
ANDHRA PRADESH
Name : M.H.Prasad Rao
Designation : HCCP
Branch : D.C.C.P.
Institute : SGM G.P.T., Abdullapurmet
Year/Semester : V Semester
Subject : VISUAL BASIC-I
Subject Code : CCP-503
Topic : MDI Applications and Graphics
Duration : 50 Mts
Sub-Topic : Graphics - Lines
Teaching Aids used : PPT, Animations, Window
outputs
CCP503.53 1
OBJECTIVES
After completion of this class, you would
be able to:
Know what is a line
CCP503.53 2
Know what is a Line
Definition:
A Line is a line that connects two points on a plane.
Each point is represented by its coordinate values.
CCP503.53 3
Know what is a Line
Shows a line joining two points whose coordinates
are shown in the PIcture
Fig:1
CCP503.53 4
Different ways of drawing lines
CCP503.53 5
Using Line Control to draw lines
on form
Identifying Line Control
Fig:2
CCP503.53 6
Line Control’s Properties
Understand the line’s properties
Border color
Border style
Border width
CCP503.53 7
Changing Line’s direction
Line’s direction can be changed:
with mouse.
by changing coordinate values of its end points
in property sheet or programmatically during run
time
Fig:3 CCP503.53 8
Changing Line’s color
Explanation:
Bordercolor property helps in changing
line’s color
Fig:4
CCP503.53 9
By setting Bordercolor property to any of the
following named constants of colors or by a
hex number
vbRed, vbGreen, vbBlue, vbMagenta,
vbwhite etc.
CCP503.53 10
Changing Line style
Explanation:
Borderstyle property helps in changing line’s style
Fig:5
CCP503.53 11
By setting Borderstyle property to any of the
values shown in the property sheet above
such as 0,1, 2 etc.
CCP503.53 12
Changing Line’s width
Explanation:
Borderwidth property helps in changing line’s
width
Fig:6
CCP503.53 13
By setting Borderwidth property to any
integer value not exceeding form’s height
CCP503.53 14
Changing Line’s position on form
at design time
Explanation:
Line’s position can be changed by changing
values of line’s x1,y1,x2,y2 properties which
represent coordinates of its end points
Fig:7
CCP503.53 15
Changing Line’s position on form
at Run Time
Explanation:
Line’s position can be changed at runtime by
changing values of line’s x1, y1, x2, y2
properties which represent coordinates of its
end points as shown below:
CCP503.53 16
Changing Line’s position on form
at Run Time
x1=inputbox(“give x1 value”)
y1=inputbox(“give y1 value”)
x2=inputbox(“give x2 value”)
y2=inputbox(“givey21 value”)
Fig:8
CCP503.53 17
Summary
We have discussed about
What is a line?
CCP503.53 18
Quiz – Objective Type
1. A Line joins _______points
Two on a form
• A Line can have _________________number
Seven of
Borderstyles
• A Line’s width can be changed________________
True
CCP503.53 19
Quiz – Objective Type
3. A Line’s width should be ______ value
a) Single
b) String
c) Integer
d) control
CCP503.53 20
Frequently Asked Question
1. Explain the Line control in VB.
CCP503.53 21