16-08-22, 08:08 AM
(16-08-22, 02:59 AM)NABIL40W كتب :طالع الموضوع التالي(15-08-22, 08:22 PM)شكرامعاند الحظ كتب : لكي نرسم نقاط عند الضغط بالزر الايسر للفارة على الفورم (كانك تكتب بالقلم)
استخدم الكود التالي:
كود :
Imports System.Drawing.Drawing2D
Public Class Form1
Private Sub Form1_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Dim g As Graphics = CreateGraphics()
Dim e1 As New PaintEventArgs(g, New Rectangle)
AddLinesExample(e1, e.Location)
End If
End Sub
Dim myPointArray As New List(Of Point)
Public Sub AddLinesExample(ByVal e As PaintEventArgs, epos As Point)
'Create a symetrical triangle using an array of points.
myPointArray.Add(New Point(epos))
Dim myPath As New GraphicsPath
myPath.AddLines(myPointArray.ToArray)
' Draw the path to the screen.
Dim myPen As New Pen(Color.Black, 2)
e.Graphics.DrawPath(myPen, myPath)
End Sub
End Class
لكنني اريد رسمها بلاحداثيات
http://vb4arb.com/vb/thread-4936.html

