Drawing Lines

GamesRule
03-18-2004, 11:37 AM
Hey

How the heck do you draw lines in .Net?

I tried:


Dim MyGraphics As Graphics
Dim myPen As New Pen(Color.Blue, 2)

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
myPen.DashStyle = Drawing2D.DashStyle.Dash

MyGraphics.DrawLine(myPen, 0, 0, 100, 0)

End Sub

Giglimesh
03-27-2004, 07:41 PM
Dont you need to set a starting point of the line and the lengh?

Iceplug
03-28-2004, 12:51 PM
The points are in the .DrawLine parameters, and the width is specified by the pen (2, in this case)... what's probably happening is that you are drawing to the form before the form is drawn... you should try moving this into the Form.Click event. :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum