Hi Nacho,
AFIAK there is no such property in TextBox nor in Label. You can use this
functionality out of the box only when you draw text directly using Graphics
objects (see StringFormat.Trimming property). However in the case where you
want to trim with ellipsis at the end of the string it is not hard to
calculate the text length by yourself. Other trimming are not hard either,
but need more work.
So here is a sample that does this
string longStr = "This is some string that doesn't fit in the textbox";
Font f = this.textBox1.Font;
Rectangle rect = textBox1.ClientRectangle;
int charFitted;
int linesFitted;
using(Graphics g = textBox1.CreateGraphics())
{
StringFormat sf = new StringFormat(StringFormatFlags.NoWrap);
sf.LineAlignment = StringAlignment.Center;
sf.Alignment = StringAlignment.Near;
sf.Trimming = StringTrimming.EllipsisCharacter;
g.MeasureString(longStr, f, rect.Size, sf, out charFitted, out
linesFitted);
}
textBox1.Text = longStr.Substring(0, charFitted) + ((charFitted <
longStr.Length)?"...":"");
The results are not the best possible, but are pretty decent.

Signature
HTH
i kasmet
Stoitcho Goutsev (100) [C# MVP]
> Hello,
>
[quoted text clipped - 14 lines]
> Thank you for your time,
> Nacho
Nacho Nachev - 01 Oct 2004 15:18 GMT
Stoitcho,
Thank you for providing so complete solution. It works fine for me!
Kind Regards,
Nacho
/* Mnogo blagodarq! */
> Hi Nacho,
>
[quoted text clipped - 44 lines]
> > Thank you for your time,
> > Nacho