Draw line

retkehing

Well-known member
Joined
Feb 5, 2006
Messages
153
Programming Experience
Beginner
How to simply draw a line in VB.NET 2005, i mean simply drag and drop a line on the form without involving in GDI? Thank you.
 
There is no line control so it's not possible. You could hack it by using a Label or Panel with the BackColor set and the height or Width set to the desired thickness, but that is a hack. GDI+ is the proper way to do it. If you want a line control then you can create your own. Create a UserControl and use GDI+ to draw from one corner to another. Give it the appropriate properties, like colour, thickness, texture, orientation, etc. You can now add instances of that control to your forms.
 
Back
Top