Reputation: 31
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
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