我想用vb写个画图的东西
用picture控件
想画什么就画什么
跟用铅笔画图似的
怎么做啊?

解决方案 »

  1.   

    一个很简单的例子:
    Dim state
    Dim x1
    Dim y1
    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    state = 1
    x1 = X
    y1 = Y
    End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If state = 1 Then
    Picture1.Line (x1, y1)-(X, Y)
    x1 = X
    y1 = Y
    End If
    End SubPrivate Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    state = 0
    End Sub