Vous êtes sur la page 1sur 20

DEPARTMENT OF TECHNICAL EDUCATION

ANDHRA PRADESH
Name : P. Sri Vidya
Designation : Lecturer
Branch : DCCP
Institute : Govt. Polytechnic for Women, Bheemili
Semester : VI Semester
Subject : Visual Basic II
Subject code : CCP- 603
Topic : Displaying and Printing Information(1/10)
Sub Topic : Fundamentals of font setting and
Displaying text on Forms and Picture boxes
Duration : 50 min.
Teaching Aids : PPT
CCP603.1 TO 2 1
Objectives

On completion of this period, you would be


able to:
 Know about fundamentals of fonts.
 Understand the font formatting.
 Know how to display text in forms and picture
boxes.
 About print method.

CCP603.1 TO 2 2
What is font?

 Text consists of characters


 Text can be displayed on forms and picture boxes
 Text can consist of different sets of characteristics
 Each set of characteristics of text is called ‘font’
 Every font is a group of characteristics that can be
applied to selected text to change its appearance

CCP603.1 TO 2 3
 Font characteristics include

 Font type
 Font size
 Font color
 Others

CCP603.1 TO 2 4
What is True type font?

 True type fonts are scalable, i.e., they can


reproduce a character at any size

 When we select a True type font, it is rendered


into the selected point size and displayed as a
bitmap on the screen

CCP603.1 TO 2 5
Does Windows OS support various types
of fonts?

 The Windows-98 and Windows NT OS provide us


with a complete set of standard fonts.

CCP603.1 TO 2 6
Characteristics of fonts

The following properties of font can be set:

 Color : Allows the user to set the font with

selected color
 Font Bold : ‘True’ for Bold;’False’ for normal.
 Font Italic : ‘True’ for Italic;’False’ for normal.

CCP603.1 TO 2 7
Characteristics of fonts

 FontStrikeThru: ‘True’ for Strikethru;’False’ for


normal
 Font Underline: ‘True’ for Underline;’False’ for
normal

CCP603.1 TO 2 8
Creating a new font

 We can create our own font using StdFont object & apply
it to text programmatically as shown below.

Dim X As New StdFont


X.Bold = True
X.Name=“Arial”
X.Size=28
Set text1.font=X

CCP603.1 TO 2 9
How can we display a text on a Form?

 Using print method:


E.g.:Form1.Print “Govt. Polytechnic For Women”.

 For the current form we need not give the form name.
E.g.: Print “Govt. Polytechnic For Women”.

CCP603.1 TO 2 10
How can we display text on a picture box?

● Using print method:

E.g. : Picture1.Print “GPTW college,Bhimili”.

CCP603.1 TO 2 11
Can we display multiple text items on form
or picture box?

Multiple text items can be displayed on the form or


picture box
 separated by commas, semicolons or both.
 Comma leaves 8 spaces.
 Semicolon does not leave any space.

CCP603.1 TO 2 12
What happens if the form or picture box is
too small to display all the text?

 The text will be cut off.


 We cannot scroll through a form or picture box.

CCP603.1 TO 2 13
Summary

 Text vs Fonts
 Characteristics of Fonts
 True type Fonts
 Changing Font characteristics
 Creating Fonts programmatically
 Print method to display text on forms and picture
boxes.

CCP603.1 TO 2 14
Quiz

1. ____ is not one of the characteristics of font


a) Bold
b) Color
c) Size
d) Spelling

CCP603.1 TO 2 15
 Font formatting allows the following operations.
a) Bold
b) Italic
c) Size
d) All the above

CCP603.1 TO 2 16
3. We can display the text on the form using

a) Display method
b) Print method
c) Print form method
d) Show method

CCP603.1 TO 2 17
Frequently asked questions

1. List the characteristics of fonts that can be


changed.
2. How can text be displayed on forms and picture
boxes?

CCP603.1 TO 2 18
Assignment

1. Display text on forms and picture boxes and


change their fonts programmatically

CCP603.1 TO 2 19
Thank you

CCP603.1 TO 2 20

Vous aimerez peut-être aussi