To draw a line with code you need to use GDI +(i.e. the .NET graphics library)
In VB:
Private Sub btnOk_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim g As Graphics = e.Graphics
Dim penLine As Pen = New Pen(Color.CornflowerBlue, 12)
g.DrawLine(penLine, 15, 0, 15, Me.Height)
penLine.Dispose()
End Sub
In C#:
private void btnOk_Paint(object sender,System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen penLine = new Pen(Color.CornflowerBlue, 12);
g.DrawLine(penLine, 15, 0, 15, this.Height);
penLine.Dispose();
}