Hy tommy2train,
i executed the simple program with 2 lines.
In the other example of several lines one on the other, you are updating the drwaing each time. If you add a line each time, it happens exactely what i'm experiencing, the preceding lines are deleted.
Change:
For i As Integer = 0 To MyLines.Count - 1 .DrawLine(RedPen, MyLines(i).x1, MyLines(i).y1, MyLines(i).x2, MyLines(i).y2) RedPen.Width += 2 Nextto
If MyLines.Count > 0 Then .DrawLine(RedPen, MyLines(MyLines.Count - 1).x1, MyLines(MyLines.Count - 1).y1, MyLines(MyLines.Count - 1).x2, MyLines(MyLines.Count - 1).y2) End Ifto see this.
Enzo
First off don't do that? Why do you do that? To break it? As I said don't just make code you think should work and then come hear and say there is something wrong with vb.net. Learn how it works and then write code that works. If you get an error come and say I don't understand. Or something like that. I don't see why you make that change?
Argggg... show us the whole thing in code! Make the whole one form example that we can run like I do. Don't make us guess what you mean!
But first...
Put a break on the first line in the sub and single step through the entire loop and etc until you exit the sub.... and most likely return? Watch what happens. If it is not clear what I mean with these debug phrases break and single step then look them up and then ask if needed (Hany).
Hany are you watching and learning how to debug?