KADUNA POLYTECHNIC
DEPARTMENT OF COMPUTER SCIENCE
COMPUTER GRAPHICS AND ANIMATION
COM 422
CREATION OF TEXT AND POINTS USING VISUAL BASIC 6
BY
GROUP 4
CST23HND0012 ABDULMALIK TANGAZA SALISU
CST23HND0218 CHRISTIANA ANUOLUWA
OSUNDERU
CST23HND0266 ABUBAKAR SADIQ MUSTAPHA
CST23HND0712 ABBAS ABUBAKAR
CST23HND0743 NAFISA AHMAD
CST23HND0774 WASILAT MAARUF
CST23HND1738 JOHN CALEB DYEP
CST23HND1819 FARIDA ISAH
CST23HND1860 RAISA TANKO SULAIMAN
CST23HND1954 BOLANLE DORCAS BOYEDE
CST23HND2067 FAITH ABIATHER BENSON
CST23HND2184 HAFSAT TUKUR
SUBMITTED
TO
MRS ZUBAIR MOMOH
12th JULY, 2025
Activity: For students to understand VB graphics.
Aim: To make students understand how to create text and points using VB.
Procedure: Launch VB, write code, and create cmdbtns to generate different types
of graphics.
Exercise:
1. Create a btn captioned "Print Text".
2. Print your name and registration number, and set the origin starting from
coordinate (0,0), with each detail starting on a new line.
3. Change the coordinates of the first line to start at (1000, 1500) and add (300,
300) on the starting coordinate of the previous line to create the starting coordinate
of the next line.
4. Change the font style, size, and color of each line.
5. Create a form captioned "Draw Point".
6. Draw a point of width set to 10 and (100, 500).
7. Draw 3 points relative to the point in (6), width = 10, shift by 300 in the x-axis
only.
Visual Basic Graphics Exercise – SOLUTION WITH STEP-BY-STEP
GUIDE
Activity Objective
To understand how to use VB6 graphics capabilities such as printing text and
drawing points using coordinates, color, font, and size.
Steps taken to answer all exercises:
We launched Microsoft Visual Basic 6.0
Select Standard EXE:
A form named Form1 is created by default
Exercise 1: Create a button captioned "Print Text"
Steps:
● In the Toolbox, we selected CommandButton
● Dragged it to the Form
● In the Properties window:
Form1.Name = cmdPrintText
Form1.Caption = Print Text
Exercise 2: Print your name and registration number set the origin at
coordinate (0,0), each on a new line:
First step was to Double-click on the button on the design view and directed us to
this code editor, where we could write our VB code:
Next, wrote VB codes to print the details:
And below is the screenshot of the output:
How We Ran It:
Press F5, click Print Text
Exercise 3. Change the coordinates of the first line to (1000, 1500), and add
(300, 300) to create the next line’s starting point.
Steps:
How We Ran It:
● Press F5, click Print Text
● The text is printed on specific coordinates
Updated the existing code in the code editor, screenshot below:
Below is the screenshot of the output:
How We Ran It:
● Press F5, click Print Text
● The text is printed on specific coordinates
Exercise 4. Change the font style, size, and color of each line
Steps:
We added FontColor, ForeSize, FontName to modify the text. Here is the
screenshot of the code:
How We Ran It:
● Press F5, click Print Text
● The text is printed on specific coordinates
Here is the screenshot of the code output:
Exercise 5. Create a form captioned "Draw Point"
Created a new Form named cmdDrawPoint
Steps:
● Add another button from the Toolbox
● Caption = Draw Points
Exercise 6. Draw a point of width = 10, Coordinates (100, 500)
Steps:
● Double-click on the button captioned Draw Points
● A new code editor is opened
Before we could see the output, we needed to set this new form as the Startup
object:
Steps:
Selected Property on the navigation bar:
Selected the new form from the Startup object drop-down:
Then finally, here is the screenshot of the code to draw a point with width of 10
and coordinates(100,500):
How We Ran It:
● Press F5, click Print Text
● The point is printed on specific coordinates
Exercise 7. Draw 3 more points relative to the Exercise 6, each shifted 300 on
X-axis, width still 10
Steps:
Returned to the code editor, by adding 300 only on the X axis only, here is the
screenshot of the code:
Below is the output,
How We Ran It:
● Press F5, click Print Text
● The points are printed on specific coordinates horizontally spaced.