Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

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:

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...