Draw horizontal divider in winforms

.NetWinforms

.Net Problem Overview


In the standard windows installer there is a divider between the control buttons on the bottom and the main part of the form. Does anyone know how this would be done in winforms/.net? I've tried fiddling around with the border settings on Panel controls etc, but haven't been able to get the same result...

alt text

.Net Solutions


Solution 1 - .Net

I used Spy++ to figure this out a while ago and discovered that it's just a standard Win32 Static control -- the equivalent of the WinForms Label. Steps for getting the same effect:

  1. Add a Label control to your form.
  2. Set Label Text to empty.
  3. Set BorderStyle to Fixed3D.
  4. Set AutoSize to false.
  5. Set Height to 2 (most easily accomplished by typing 2 into the Size/Height field under Label Properties).

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNathanView Question on Stackoverflow
Solution 1 - .NetDavid AndersonView Answer on Stackoverflow