Draw, move, and delete line segments in VB.NET

[line editor]

This progra lets you draw, move, and delete line segments from a drawing. It’s a Visual Basic .NET version of the example Draw, move, and delete line segments in C# made by request.

Click and drag to draw line segments. If you click on a segment’s end point, you can drag it into a new position. If you click on a segment’s body, you can move the whole segment. Finally if you drag a segment onto the trash can icon, the program asks if you want to delete the segment.

See the original post for an explanation of how the program works.

Download Example   Follow me on Twitter   RSS feed   Donate

About RodStephens

Rod Stephens is a software consultant and author who has written more than 30 books and 250 magazine articles covering C#, Visual Basic, Visual Basic for Applications, Delphi, and Java.
This entry was posted in drawing, graphics and tagged , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

3 Responses to Draw, move, and delete line segments in VB.NET

  1. Marino Liranzo says:

    Hello Mr. Rod Stephens,

    I am working on a small application in which I draw straight lines and rectangles in a picturebox. I would like to know how to implement the Undo and ReDo functionalities when I am creating lines.

    If you could help me with an example of the code.

    Marino Liranzo

  2. Marino Liranzo says:

    Thank Mr. Rod Stephens,
    You are very kind.
    I will try to make my code starting from this example

    Marino Liranzo

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.