Mike Taulty's Blog
Bits and Bytes from Microsoft UK
Silverlight 4 Rough Notes: TextBlock with Trimming

Blogs

Mike Taulty's Blog

Elsewhere

Archives

Note – these posts are put together after a short time with Silverlight 4 as a way of providing pointers to some of the new features that Silverlight 4 has to offer. I’m posting these from the PDC as Silverlight 4 is announced for the first time so please bear that in mind when working through these posts.

A simple new feature in Silverlight 4 – if you have a TextBlock where the text overflows the space available then you can set the TextTrimming property;

    <TextBlock
            Text="The quick brown fox jumps over the lazy dog"
            TextTrimming="WordEllipsis" />

with the effect that as I resize the browser window ( in this case );

image

it displays the familiar “…” to indicate that there’s more text that is revealed if I give the text more space.


Posted Wed, Nov 18 2009 12:22 PM by mtaulty
Filed under: ,

Comments

John wrote re: Silverlight 4 Rough Notes: TextBlock with Trimming
on Thu, Nov 19 2009 1:15 PM

Excellent!  A tooltip would be cool to add to this so you can see the entire text if you hover the mouse cursor over it.