Private Sub Command1_Click()
a = InputBox("请输入第一个点的横坐标", "计算矩形面积", 1)
b = InputBox("请输入第二个点的纵坐标", "计算矩形面积", 1)
c = InputBox("请输入第三个点的横坐标", "计算矩形面积", 1)
d = InputBox("请输入第四个点的纵坐标", "计算矩形面积", 1)
line1.X1 = a
line1.Y1 = b
line1.X2 = c
line1.Y2 = b
line2.X1 = c
line2.Y1 = b
line2.X2 = c
line2.Y2 = d
line3.X1 = c
line3.Y1 = d
line3.X2 = a
line3.Y2 = d
line4.X1 = a
line4.Y1 = d
line4.X2 = a
line4.Y2 = b
line1.Visible = True
line2.Visible = True
line3.Visible = True
line4.Visible = True
i=msgbox(0+64+0, "矩形面积",0,1,)
j = MsgBox((c - a) * (d - b), 0 + 64 + 0, "矩形周长", 0, 1)
End Sub
a = InputBox("请输入第一个点的横坐标", "计算矩形面积", 1)
b = InputBox("请输入第二个点的纵坐标", "计算矩形面积", 1)
c = InputBox("请输入第三个点的横坐标", "计算矩形面积", 1)
d = InputBox("请输入第四个点的纵坐标", "计算矩形面积", 1)
line1.X1 = a
line1.Y1 = b
line1.X2 = c
line1.Y2 = b
line2.X1 = c
line2.Y1 = b
line2.X2 = c
line2.Y2 = d
line3.X1 = c
line3.Y1 = d
line3.X2 = a
line3.Y2 = d
line4.X1 = a
line4.Y1 = d
line4.X2 = a
line4.Y2 = b
line1.Visible = True
line2.Visible = True
line3.Visible = True
line4.Visible = True
i=msgbox(0+64+0, "矩形面积",0,1,)
j = MsgBox((c - a) * (d - b), 0 + 64 + 0, "矩形周长", 0, 1)
End Sub