在VB中画直线,怎样使画下一条直线时,上一条直线保留?求回答啊,对的话我会加分的.

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 21:30:01
在VB中画直线,怎样使画下一条直线时,上一条直线保留?求回答啊,对的话我会加分的.

在VB中画直线,怎样使画下一条直线时,上一条直线保留?求回答啊,对的话我会加分的.
在VB中画直线,怎样使画下一条直线时,上一条直线保留?
求回答啊,对的话我会加分的.

在VB中画直线,怎样使画下一条直线时,上一条直线保留?求回答啊,对的话我会加分的.
Dim a As Single,b As Single
Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)
a = X:b = Y
End Sub
Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)
If Button = 1 Then
Me.Cls
Me.Line (a,b)-(X,Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)
Me.Cls
Me.AutoRedraw = True
Me.Line (a,b)-(X,Y)
Me.AutoRedraw = False
End Sub