开发者

Hide overflow in Silverlight TextBox

开发者 https://www.devze.com 2022-12-29 23:43 出处:网络
I have a Silverlight TextBox control that is insideof 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

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 text开发者_开发问答box'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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号