VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   5760
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7050
   LinkTopic       =   "Form1"
   ScaleHeight     =   5760
   ScaleWidth      =   7050
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command1 
      Caption         =   "New Lines"
      Height          =   495
      Left            =   4440
      TabIndex        =   0
      Top             =   4440
      Width           =   1215
   End
   Begin VB.Line Line1 
      Index           =   0
      Visible         =   0   'False
      X1              =   360
      X2              =   3480
      Y1              =   600
      Y2              =   1080
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()

    Dim X1 As Integer
    Dim X2 As Integer
    Dim Y1 As Integer
    Dim Y2 As Integer
    Dim ctr As Integer
    
    Randomize
    
    ' create 10 lines
    Do Until ctr > 8
        X1 = Int((5001) * Rnd) ' Create numbers from 0 to 5000
        Do Until X2 > X1
            X2 = Int((5001) * Rnd)
        Loop
        
        Y1 = Int((5001) * Rnd)
        Do Until Y2 > Y1
            Y2 = Int((5001) * Rnd)
        Loop
        
        Load Line1(Line1.Count)
        Line1(Line1.UBound).X1 = X1
        Line1(Line1.UBound).X2 = X2
        Line1(Line1.UBound).Y1 = Y1
        Line1(Line1.UBound).Y2 = Y2
        Line1(Line1.UBound).Visible = True
        
        ctr = ctr + 1
    Loop
    
End Sub


