请教大侠们一个关于VB的小问题~~~~~~~~

来源:百度知道 编辑:UC知道 时间:2024/06/10 09:16:11
为什么这样写了,还不能画啊~~~~~~~~
Dim PaintNow As Boolean
Private Sub Form_DblClick()
Cls
End Sub
Private Sub Form_Load()
DrawWidth = 2
ForeColor = RGB(0, 0, 255)
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
PaintNow = ture
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If PaintNow Then
PSet (X, Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
PaintNow = False
End Sub

在最顶上加Option Explicit 就会发现:
ture : 变量未定义
呵呵,拼错了
应该是True

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button=1 Then
PSet (X, Y)
End If
end sub
这样子不是简单点?

要达到什么效果?
hi me is OK

你加个IMAGE控件啊!!
VB中窗体中能画吗??