I use FlowLayoutPanel to store shortcuts from left to right. Thus, automation and overlap break my well-aligned columns. I think the most direct way is to simply implement the paint yourself. Helpers exist to make an ellipse for you.
This latest TextFormatFlags has a dozen options that save you unnecessary drawing code.
private void templateLabel_Paint(object sender, PaintEventArgs e)
{
Label lbl = sender as Label;
e.Graphics.Clear(lbl.BackColor);
TextRenderer.DrawText(e.Graphics, lbl.Text, lbl.Font,
lbl.ClientRectangle,
Color.Black,
lbl.BackColor, TextFormatFlags.EndEllipsis);
}
source
share