我想作一个很简单的类似微软自带的画笔中的铅笔功能.
我是这样写代码的
Option Explicit
Dim a As Boolean
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
a = True
End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If a = True Then
Form1.DrawWidth = 5
Form1.PSet (X, Y)End If
End SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
a = False
End Sub可是画出来的点断断续续,不连贯,怎么回事?有什么办法解决吗?

解决方案 »

  1.   

    Option Explicit
    Dim a As Boolean
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    a = True
    Form1.DrawWidth = 5
    Form1.PSet (X, Y)
    End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If a = True Then
    Form1.Line -(X, Y)End If
    End SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    a = False
    Form1.Line -(X, Y)End Sub可是画出来的点断断续续,不连贯,怎么回事?有什么办法解决吗?
      

  2.   

    To feixuehenshui(飞雪恨水):
    你的IE是那个版本的?装IE6试试
      

  3.   

    你可以试一试我这个:private lx,ly as longprivate sub form_load()
    me.AutoRedraw =True 
    end subPrivate Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    lft = True
    lx = X
    ly = Y
    End SubPrivate Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If lft = True Then
    Form1.Line (lx, ly)-(X, Y)
    lx = X
    ly = Y
    End IfEnd SubPrivate Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    lft = False
    End Sub