title: Drawing line in vb.net
body: <p>I am trying to use the following code in a button.  I want to call DrawLineFloat.  I tried call DrawLineFloat() but it did not work.  What do I need to enter in ()?</p>
  
  <p>Thanks</p>
  
  <pre><code> Public Sub DrawLineFloat(ByVal e As PaintEventArgs)
      ' Create pen.
      Dim blackPen As New Pen(Color.Black, 3)
      ' Create coordinates of points that define line.
      Dim x1 As Single = 100.0F
      Dim y1 As Single = 100.0F
      Dim x2 As Single = 500.0F
      Dim y2 As Single = 100.0F
      ' Draw line to screen.
      e.Graphics.DrawLine(blackPen, x1, y1, x2, y2)
  End Sub
  </code></pre>