Option Explicit
Dim a As Integer,b As Integer
Private Sub cmdfill_Click()
b = Int(Rnd * 4)
Select Case b
Case 0
Shp1.FillStyle = vbFSSolid
Shp1.FillColor = QBColor(1)
Case 1
Shp1.FillStyle = vbCross
Shp1.FillColor = QBColor(3)
Case 2
Shp1.FillStyle = vbHorizontalLine
Shp1.FillColor = QBColor(9)
Case 3
Shp1.FillStyle = vbHorizontalLine
Shp1.FillColor = QBColor(13)
End Select
End Sub
Private Sub cmdshape_Click()
a = Int(Rnd * 6)
Select Case a
Case 0
Shp1.Shape = vbShapeRectangle
Case 1
Shp1.Shape = vbShapeSquare
Case 2
Shp1.Shape = vbShapeOval
Case 3
Shp1.Shape = vbShapeCircle
Case 4
Shp1 = vbShapeRoundedRectangle
Case 5
Shp1.Shape = vbShapeRoundedSquare
End Select
End Sub