option explicit
dim intindex1 as integer
dim intindex2 as integer
private type point
x as integer
y as integer
end type
dim point1 as point
dim point2 as point
dim point3 as point
private sub command1_click()
intindex1 = intindex1 + 1
select case intindex1
case 1
picture1.line -(point1.x, point1.y)
case 2
picture1.line -(point2.x, point2.y)
case 3
picture1.line -(point3.x, point3.y)
end select
if intindex1 = 3 then intindex1 = 0
end sub
private sub command2_click()
me.picture1.cls
intindex2 = intindex2 + 1
select case intindex2
case 1
picture1.line (0, 0)-(point1.x, point1.y)
case 2
picture1.line (point1.x, point1.y)-(point2.x, point2.y)
case 3
picture1.line (point2.x, point2.y)-(point3.x, point3.y)
end select
if intindex2 = 3 then intindex2 = 0
end sub
private sub form_load()
point1.x = 100
point1.y = 100
point2.x = 200
point2.y = 800
point3.x = 1000
point3.y = 1000
end sub