VB工程20--百例38--图形变换填充

前端之家收集整理的这篇文章主要介绍了VB工程20--百例38--图形变换填充前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

猜你在找的VB相关文章