程序可以运行但是不出图像,请问哪里不对?
Dim x1, y1, x2, y2, left_c As IntegerDim tool1, tool2, tool3, tool4 As Integer
Private Sub Form_Load()
left_c = 0
End Sub
Private Sub Command1_Click()
tool1 = 1
End Sub
Private Sub Command2_Click()
tool2 = 1
End Sub
Private Sub Command3_Click()
tool3 = 1
Picture1.ForeColor = QBColor(10)
End Sub
Private Sub Command4_Click()
tool4 = 1
Picture1.ForeColor = QBColor(9)
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If too1 = 1 And tool2 = 0 And tool3 = 1 And too4 = 0 Then
If Button = 0 Then
left_c = 0
Else
If left_c = 0 Then
x1 = X
y1 = Y
left_c = 1
Else
x2 = X
y2 = Y
Picture1.Line (x1, y1)-(x2, y2)
x1 = x2
y1 = y2
End If
End If
'-----------------------------------------------------
ElseIf too1 = 1 And tool2 = 0 And tool3 = 0 And too4 = 1 Then
If Button = 0 Then
left_c = 0
Else
If left_c = 0 Then
x1 = X
y1 = Y
left_c = 1
Else
x2 = X
y2 = Y
Picture1.Line (x1, y1)-(x2, y2)
x1 = x2
y1 = y2
End If
End If
'-----------------------------------------------------
ElseIf too1 = 0 And tool2 = 1 And tool3 = 1 And too4 = 0 Then
If left_c = 0 Then
x1 = X
y1 = Y
left_c = 1
Else
x2 = X
y2 = Y
Picture1.Line (x1, y1)-(x2, y2)
left_c = 0
End If
'-----------------------------------------------------
ElseIf too1 = 0 And tool2 = 1 And tool3 = 0 And too4 = 1 Then
If left_c = 0 Then
x1 = X
y1 = Y
left_c = 1
Else
x2 = X
y2 = Y
Picture1.Line (x1, y1)-(x2, y2)
left_c = 0
End If
End If
End Sub