Is there a way to draw a separator line in a form? Much like an HR in the web world? Just for visual separation of fields?
Thanks in advance!
Separator Line
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Scott LysleRank #49 · 31K reputationPosted Apr 8, 2007, 9:53 PM EDT
in a win forms label control and get a horizontal line (it would be nice if you could). You can draw the lines using GDI, or you can use an image of the line. If you cannot group and box up your controls using group boxes here is a cheap trick that might work for you. Add two labels to the form, set the Bold property to true on both and fill the labels with underscore characters to get the width you want. Make one white and one black. Click on one and use the arrow keys to drive it down to point where the lines very nearly overlap. The result looks like a 3D line which you could use as a separator.
Lisa M41 reputationPosted Apr 9, 2007, 4:31 AM EDT
Sokak37 reputationPosted Apr 10, 2007, 9:41 PM EDT
For solid lines of various widths use the same trick with a blank label and appropriate background color, height/width set to desired thickness.
Limited of course to horizontal & vertical lines. Diagonals you need to use GDI+.