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!
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SokakPosted Apr 11, 2007, 1:41 AM
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+.
Lisa MPosted Apr 9, 2007, 8:31 AM
Scott LyslePosted Apr 9, 2007, 1:53 AM
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.