Program 1
Private
Sub Command1_Click()
CurrentX = 500
CurrentY = 1000
Print "This is a new text"
End
Sub
Program 2
Private
Sub Command1_Click()
DrawWidth
= 10
PSet (100, 500)
End
Sub
Program 3
Private
Sub Command1_Click()
DrawWidth = 10
CurrentX = 500
CurrentY
= 500
PSet Step(0, 0)
End
Sub
Program 4
Private
Sub Command1_Click()
DrawWidth = 5
'A hyphen is required between the points
Line (0, 0)-(2000, 2000), vbBlue
End
Sub
Program 5
Private
Sub Command1_Click()
DrawWidth = 1
DrawStyle = 1
'A hyphen is required between the points
Line (0, 0)-(2000, 2000), vbBlue
DrawStyle = vbDashDot
Line (100, 900)-(2800, 2800), vbRed
End
Sub
Program 6
Private
Sub Command1_Click()
DrawWidth = 3
Circle (1800, 1800), 1000, vbRed
End
Sub
Program 7
Private
Sub Command1_Click()
FillStyle = vbSolid
FillColor = &H80C0FF
DrawWidth = 3
Circle (1800, 1800), 1000, vbRed
End
Sub
Program 8
Private
Sub Command1_Click()
DrawWidth = 3
Line
(300, 300)-Step(4000, 2000), vbBlue, B
End
Sub
Program 9
Private
Sub Form_Paint()
DrawWidth = 5
Circle (Rnd * 3000, Rnd * 7000), Rnd * 800,
vbYellow
End
Sub
Program 10
Private
Sub Form_Load()
Dim
i As Integer
Dim
x As Single
Dim
y As Single
Picture1.Scale (-10, 10)-(10, -10)
' Draw X axis.
Picture1.Line (-10, 0)-(10, 0)
For i = -9 To 9
Picture1.Line (i, -0.5)-(i, 0.5)
Next i
' Draw Y axis.
Picture1.Line (0, -10)-(0, 10)
For i = -9 To 9
Picture1.Line (-0.5, i)-(0.5, i)
Next i
' Draw y = 4 * sin(x).
Picture1.ForeColor = vbRed
x = -10
y = 4 * Sin(x)
Picture1.CurrentX = x
Picture1.CurrentY = y
For x = -10 To 10 Step 0.25
y = 4 * Sin(x)
Picture1.Line -(x, y)
Next x
' Draw y = x ^ 3 / 5 - 3 * x + 1.
Picture1.ForeColor = vbBlue
x = -10
y = x ^ 3 / 5 - 3 * x + 1
Picture1.CurrentX = x
Picture1.CurrentY = y
For x = -10 To 10 Step 0.25
y = x ^ 3 / 5 - 3 * x + 1
Picture1.Line -(x, y)
Next x
End
Sub
No comments:
Post a Comment
Note: only a member of this blog may post a comment.