Search code examples
c#winformsautosize

AutoSize vertically while AutoEllipsis horizontally on label control


I want to place a label on the bottom left corner of an user control. The control may vary in size by horizontally and vertically. When the horizontal resize is reduced so that the label cannot be shown fully, I want the AutoEllipsis to kick in. But on the other hand, I dont want my control floating from the left bottom, because the height of the label is not autosized (which makes the text stay above a few pixels higher than autosized label).

So I want to know how to set AutoEllipsis horizontally but keep AutoSize vertically on a label control. Help me out.

AutoSize = true; AutoEllipsis = false Autosize = false; AutoEllipsis = true


Solution

  • Try to set these properties for the label:

    AutoEllipsis = true
    Anchor = Top, Bottom, Left
    AutoSize = false
    

    Update: Try these properties:

    AutoEllipsis = true
    TextAlign = TopLeft
    Anchor = Bottom, Left, Right
    AutoSize = false