Private Sub Command1_Click()
Dim I As Integer, X1 As Integer, Y1 As Integer, X2 As Integer, Y2 As Integer
Dim ColorR As Long, ColorG As Long, ColorB As Long, DrawColor As Long
Randomize
Cls
ScaleMode = 3 ' 设置 ScaleMode 为像素
DrawMode = 13 '输出外观(前景色与背景色的 *** 作方式)
DrawStyle = 0 '线条样式
'【0(缺省值)实线,1 虚线,2 点线,3 点划线,4 双点划线,5 无线,6 内收实线】
For I = 1 To 20
X1 = Rnd * Me.ScaleWidth
Y1 = Rnd * Me.ScaleHeight
X2 = Rnd * Me.ScaleWidth
Y2 = Rnd * Me.ScaleHeight
DrawWidth = Rnd * 10 + 1 '线条宽度,数值可选为1~32767,不过太大了就无法分辨了
ColorR = Rnd * 256
ColorG = Rnd * 256
ColorB = Rnd * 256
DrawColor = (((256 * ColorR) + ColorG) * 256) + ColorB
ForeColor = DrawColor
Line (X1, Y1)-(X2, Y2)
Next
End Sub
Private Sub Check1_Click()Label1.Font.Underline = IIf(Check1.Value = vbChecked, True, False)
End Sub
Private Sub Check2_Click()
Label1.Font.Strikethrough = IIf(Check2.Value = vbChecked, True, False)
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)