Wrap text in button content in Silverlight 4

I dynamically create buttons on a page, and some may be longer than others. The buttons are the same size, so I want content that is just text to be wrapped. How to do it?

+3
source share
2 answers

According to the link provided by Vap0r, here is a more specific answer to the original question regarding dynamically generated buttons:

Button bt = new Button();
TextBlock tb = new TextBlock();
tb.Text = "Text to be wrapped";
tb.TextWrapping = TextWrapping.Wrap;
bt.Content = tb;
+6
source

This post will help you.
He pretty much instructs you to open the button tag and make the text inside the shell of the text block.

+1
source

All Articles