VERSION 5.00
Begin VB.Form Form1 
   AutoRedraw      =   -1  'True
   Caption         =   "VB6 例10-9 随机射线"
   ClientHeight    =   2460
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4995
   LinkTopic       =   "Form1"
   ScaleHeight     =   2460
   ScaleWidth      =   4995
   StartUpPosition =   3  '窗口缺省
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form_Click()
    Dim i As Integer, x As Single, y As Single
    Scale (-320, 240)-(320, -240)
    For i = 1 To 100
        x = 320 * Rnd                           ' 产生x坐标
        If Rnd < 0.5 Then x = -x
        y = 240 * Rnd                           ' 产生y坐标
        If Rnd < 0.5 Then y = -y
        colorcode = 15 * Rnd                    ' 产生色彩代码
        Line (0, 0)-(x, y), QBColor(colorcode)
    Next i
End Sub

