VB6.0中如何实现在picturebox上自由画画 求大神看看哪里不对,为什么会出现这种情况
IfButton=1ThenSelectCaseCombo1.TextCase"红色"Picture1.Line(CurrentX,CurrentY)-(X,Y),vbR...
If Button = 1 Then
Select Case Combo1.Text
Case "红色"
Picture1.Line (CurrentX, CurrentY)-(X, Y), vbRed
Case "绿色"
Picture1.Line (CurrentX, CurrentY)-(X, Y), vbGreen
Case "黄色"
Picture1.Line (CurrentX, CurrentY)-(X, Y), vbYellow
Case "黑色"
Picture1.Line (CurrentX, CurrentY)-(X, Y), vbBlack
End Select
end sub
哪里不对? 展开
Select Case Combo1.Text
Case "红色"
Picture1.Line (CurrentX, CurrentY)-(X, Y), vbRed
Case "绿色"
Picture1.Line (CurrentX, CurrentY)-(X, Y), vbGreen
Case "黄色"
Picture1.Line (CurrentX, CurrentY)-(X, Y), vbYellow
Case "黑色"
Picture1.Line (CurrentX, CurrentY)-(X, Y), vbBlack
End Select
end sub
哪里不对? 展开
1个回答
展开全部
Dim Drawing As Boolean
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If Not Drawing Then
Drawing = True
Picture1.PSet (X, Y), vbBlack
Else
Select Case Combo1.Text
Case "红色"
Picture1.Line -(X, Y), vbRed
Case "绿色"
Picture1.Line -(X, Y), vbGreen
Case "黄色"
Picture1.Line -(X, Y), vbYellow
Case "黑色"
Picture1.Line -(X, Y), vbBlack
End Select
End If
End If
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Drawing = False
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询