Код: Выделить всё
[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.StatusStrip)]
public partial class SpringLabel : ToolStripStatusLabel
{
public SpringLabel()
{
this.Spring = true;
}
protected override void OnPaint(PaintEventArgs e)
{
var flags = TextFormatFlags.Left | TextFormatFlags.EndEllipsis | TextFormatFlags.VerticalCenter;
var bounds = new Rectangle(0, 0, this.Bounds.Width, this.Bounds.Height);
TextRenderer.DrawText(e.Graphics, this.Text, this.Font, bounds, this.ForeColor, flags);
}
}
Подробнее здесь: https://stackoverflow.com/questions/794 ... des-onpain
Мобильная версия