Hi everyone, I'm in this proyect where I need an area in the form where I can place just dots, then join these dots with an straight line between them.

How can I do that? I placed a Picturebox to see functions there but nothing is clear. Any help would be great, thanks!

Hi everyone, I'm in this proyect where I need an area in the form where I can place just dots, then join these dots with an straight line between them.

How can I do that? I placed a Picturebox to see functions there but nothing is clear. Any help would be great, thanks!

Can someone tell me at least which control can I use? I picturebox fine for this purpouse?

See if this helps.

Public Class Form1

    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim myGraphics As Graphics = e.Graphics
        '// draw Dots.
        Dim myDotPen As New Pen(Color.SteelBlue, 10) '// set DOT pen color and width.
        myGraphics.DrawEllipse(myDotPen, 25, 25, 10, 10) '// (preset pen, location.X, location.Y, width, height)
        myGraphics.DrawEllipse(myDotPen, 75, 25, 10, 10) '// (preset pen, location.X, location.Y, width, height)
        myGraphics.DrawEllipse(myDotPen, 125, 25, 10, 10) '// (preset pen, location.X, location.Y, width, height)
        '// draw Line.
        Dim myLinePen As New Pen(Color.SpringGreen, 5) '// set LINE pen color and width.
        myGraphics.DrawLine(myLinePen, 28, 30, 132, 30) '// (preset pen, startLocation.X, startLocation.Y, endLocation.X, endLocation.Y)
        '// dispose if not needed.
        myGraphics.Dispose() : myDotPen.Dispose() : myLinePen.Dispose()
    End Sub
End Class
Comments
Nice execution...
This question has already been answered. Start a new discussion instead.