how can make a drawing in vb, using mouse or any e-ballpen to add my signature?
Printable View
how can make a drawing in vb, using mouse or any e-ballpen to add my signature?
Not exactly sure what you are asking. Do you want to know how to make a control in VB.NET that lets you use the mouse to draw on it like the pencil-tool in MSPaint?
If you are trying to do what Jenner said, a mspaint like control, you can use a picturebox and its mousemove event. Make sure you create a new bitmap for your picturebox.image before you call this code, or you'll get an error.
Code:Dim prevX As Integer = -1
Dim prevY As Integer = -1
Private Sub PictureBox2_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox2.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Dim g As Graphics = Graphics.FromImage(PictureBox2.Image)
If prevX > 0 And prevY > 0 Then
g.DrawLine(Pens.Blue, e.X, e.Y, prevX, prevY)
PictureBox2.Refresh()
End If
prevX = e.X
prevY = e.Y
Else
prevX = -1
prevY = -1
End If
End Sub