How can I draw a line?


There's was a line control in VB 6, it's not available in C# 2.0.

How can I have one on my form?

Who is Participating?
Jaime OlivaresSoftware ArchitectCommented:
For vertical and horizontal lines, use a PictureBox.
Set BorderStyle to FixedSingle or Fixed3D
Set Width or Height to 1
Alexandre SimõesManager / Technology SpecialistCommented:
You can't...
You can have containers that draw on themselves but the "good" old VB6 Line is gone...

Something like jaime_olivares said is usually used... I use Labels, I think they're somewhat lighter.
EEssamAuthor Commented:
It seems to do the trick but how can I change the line color?
Jaime OlivaresSoftware ArchitectCommented:
Also you can use a Panel control and change the Background property
Jaime OlivaresSoftware ArchitectCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.