Borders and lines

otherside

Well-known member
Joined
Mar 16, 2003
Messages
127
Location
UK - Greece
Hello guys
Anyone knows hot to set a the border sides of a panel seperatly?
i mean like top border, bottom border left border etc. ?
If that is not possible, how can i draw a simple line in a windows forms ?
thanks
 
You have to draw it yourself.

Make a class and Inherit it from Windows.Forms.Panel.
Create a handler for the Paint event for the control. And then in it type in this code:
Code:
Private Sub Class1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
     e.Graphics.DrawLine(New Pen(Color.Blue), 0, 0, Me.Width, 0)
End Sub

The e.Graphics.DrawLine will draw a line which will look like a border becuase it is drawn along the top of the panel. You can do that for every side.

Then you just declare that class and use it on your form.
 
Back
Top