- 12 Eyl 2010
- 655
- 0
Forma hiç bir eklenti yapmanaza gerek yoktur.
kodları olduğu gibi kopyalayın ve programı başlatın çiziminizi yapın
______________________________________________________________
Public Class Form1
'Coder By_OnEseLF
Dim x1, y1 As Integer
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left Then
x1 = e.X
y1 = e.Y
End If
If e.Button = Windows.Forms.MouseButtons.Right Then
x1 = e.X
y1 = e.Y
End If
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Dim renk As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim grafik As System.Drawing.Graphics
grafik = Me.CreateGraphics()
grafik.DrawLine(renk, e.X, e.Y, x1, y1)
renk.Dispose()
grafik.Dispose()
x1 = e.X
y1 = e.Y
ElseIf e.Button = Windows.Forms.MouseButtons.Right Then
Dim renk As New System.Drawing.Pen(Me.BackColor)
Dim grafik As System.Drawing.Graphics
grafik = Me.CreateGraphics()
grafik.DrawLine(renk, e.X, e.Y, x1, y1)
renk.Dispose()
grafik.Dispose()
x1 = e.X
y1 = e.Y
End If
End Sub
End Class
_________________________________________
kodları olduğu gibi kopyalayın ve programı başlatın çiziminizi yapın
______________________________________________________________
Public Class Form1
'Coder By_OnEseLF
Dim x1, y1 As Integer
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left Then
x1 = e.X
y1 = e.Y
End If
If e.Button = Windows.Forms.MouseButtons.Right Then
x1 = e.X
y1 = e.Y
End If
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Dim renk As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim grafik As System.Drawing.Graphics
grafik = Me.CreateGraphics()
grafik.DrawLine(renk, e.X, e.Y, x1, y1)
renk.Dispose()
grafik.Dispose()
x1 = e.X
y1 = e.Y
ElseIf e.Button = Windows.Forms.MouseButtons.Right Then
Dim renk As New System.Drawing.Pen(Me.BackColor)
Dim grafik As System.Drawing.Graphics
grafik = Me.CreateGraphics()
grafik.DrawLine(renk, e.X, e.Y, x1, y1)
renk.Dispose()
grafik.Dispose()
x1 = e.X
y1 = e.Y
End If
End Sub
End Class
_________________________________________