Line on a VB.NET form

  • Thread starter Thread starter brian
  • Start date Start date
B

brian

This is driving my crazy! I can not find the option to
draw a line in VB.NET. In VB6 there was a line control
drag and drop. Can someone help please?

I am assumming it is hidden somewhere!

Thanks
 
You can use the Graphics.DrawLine method. For example:
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawLine(myPen, 0, 0, 200, 200)
myPen.Dispose()
formGraphics.Dispose()

For more you can take a look in help under "graphics, examples [Visual
Basic]" or "graphics, what's changed"

Elena Arzac

--------------------
 
This is driving my crazy! I can not find the option to
draw a line in VB.NET. In VB6 there was a line control
drag and drop. Can someone help please?

This is another question that is asked, over and over and over and over. If
you search http://groups.google.com/ you will find tons of results, or you
can search MSDN, or the .NET Help files. I belive I saw Wagner post a link
to a downloadable line control before, but here is the official MS
statement:

http://msdn.microsoft.com/library/en-us/vbcon/html/vxconchangestolinecontrolinvisualbasicnet.asp

Basically, they say use a label control with no text and no border & set the
bg color to black, and the width or height = 1

HTH

~
Jeremy
 
Back
Top