To Create The Drawing Pad Using Visual Basic
To Create The Drawing Pad Using Visual Basic
picture box, four text boxes , six command buttons and the necessary labels. The
function of the common dialog control is to assist the users to choose colors. The text
boxes are for the user to enter the coordinates and the picture box is to display the
pictures drawn. The method to draw a straight line is Line, and the syntax is as follows:
where picture1 is the picture box, (x1,y1) is the coordinates of the starting point, (x2,
y2) is the ending point and color understandably is the color of the line.
Where (x3, y3) is the center of the circle and r is the radius.
f you wish to draw a solid circle and fill it with the selected color, then add two more
lines to the above syntax:
Picture1.FillStyle = vbSolid
Picture1.FillColor = color
Picture1.Cls
The Interface
The code
End Sub
Picture1.FillStyle = vbSolid
Picture1.FillColor = color
Picture1.Circle (x3, y3), r, color
Exit Sub
addvalues:
MsgBox ("Please fill in the coordinates ,the radius and the color")
End Sub
The Interface
The code
End Sub
End Sub
If Combo1.ListIndex = 2 Then
MMControl1.DeviceType = "AVIVideo"
End If
If Combo1.ListIndex = 3 Then
MMControl1.DeviceType = ""
End If
MMControl1.FileName = Text1.Text
MMControl1.Command = "Open"
End Sub