Madison Lee
Madison Lee

Reputation: 31

Text Wrapping in Button Content in Silverlight 4

I'm dynamically creating buttons in a page and some content may be longer than others. Buttons have equal sizes so I'd want the content, which is just plain text, to be wrapped. How do I do that?

Upvotes: 3

Views: 2125

Answers (2)

Hong
Hong

Reputation: 18531

In line with the link provided by Vap0r, here is a more specific answer to the original question concerning dynamically created buttons:

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

Upvotes: 6

Vap0r
Vap0r

Reputation: 2616

This post will help you.
It pretty much instructs you to open up your button tag and make your text inside a textblock wrap.

Upvotes: 1

Related Questions