3

Using: C# .NET 4.0 Winforms - Visual C# Express 2008

.NET default controls have a pink line in designer mode that allows you to align the text within controls. E.g. a label and textbox can align text vertically when placed by aligning to the pink line even though they have different heights.

When I make custom controls however, it only allows me to align to the borders. How do I set the text line position to allow them to be aligned like above?

I couldn't find any web resources on this, probably because I don't know the technical term for these alignment guides.

Rémi
  • 3,867
  • 5
  • 28
  • 44
Louis Ingenthron
  • 1,267
  • 8
  • 21
  • 5
    They are called snaplines. It requires creating your own designer. Sample control + designer [is here](http://social.msdn.microsoft.com/forums/en-US/winforms/thread/29e9baf9-3724-4e6c-931d-7cfb00d50c71/) – Hans Passant Apr 17 '13 at 16:03

1 Answers1

1

They are called snaplines. It requires creating your own designer. Sample control + designer is here.

Kevin Panko
  • 8,356
  • 19
  • 50
  • 61