views:

171

answers:

1

I have a Silverlight TextBox control that is inside of a Grid column with the width set to 'Auto', so the TexBox's width expands/contracts with the browser window is resized. Unfortunately, when the number of characters entered into the textbox exceeds the textbox's width, the textbox grows to accommodate it.

Are there any properties that can be applied to the textbox that will force it to not expand with the number of characters inside of it?

Thanks.

A: 

Have you considered setting the TextWrapping property on the TextBox?

For example:

<TextBlock TextWrapping="Wrap"/>

This would prevent the width from increasing when the entered text is longer than the width of the TextBox.

Ben Hoffstein
Thanks for the quick response, but unfortunately, this does not fix the problem. As long as the Textbox is set to HorizontalAlignment="Stretch" and it is located inside of a Grid.Column set to Width="Auto" or "*", the issue persist.
chrisbz
Found the resolution here: http://www.r2musings.com/2009/02/12/SilverlightUIRant2ListBoxItem.aspx
chrisbz