Prologue:In this article we shall discuss one of the features in Silverlight 5 beta i.e. how to handle a TextOverflow in a Silverlight 5 application.Short intro to TextOverflow in Silverlight 5:Consider you are having a RichTextBox with the fixed height and width for displaying only 20 lines. If you fill the RTB with 100 lines then only the first 20 lines will be displayed because we have set the height and width for 20 lines. If we need to display the remaining 80 lines we have to follow the TextOverflow feature in Silverlight 5.Quick Note:Handling the TextOverflow in Silverlight 5 application is only applicable for the RichTextBox control.Preparing the Solution:Create a solution with the name TextOverflowInSL5 as shown in the figure. Follow the [No: #].Make sure our application uses the Silverlight version 5. Designing the Page [XAML]:To demonstrate the handling of the TextOverflow feature of Silverlight 5 we have designed a page like shown here. Here we simply placed a RichTextBox inside the StackPanel with four lines of paragraph. In the above code part we set the height of RTB to 40. See the next screen showing what is happening while executing this. As we have set the minimal height the paragraph has been trimmed here. We can't see the remaining 2 lines of the paragraph.To display the remaining lines we have to do one of two possible things.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: