WPF LL: TextBoxes that just keep growing

This problem was probably discovered accidentally and shows me once again how important it is to have non-technical and new people testing your programs. The problem encountered was that the TextBoxes on one of our Windows would just keep expanding if you typed past its normal width. This would cause the form to expand, so if you typed enough the form would get wider than the screen. We found the problem not because someone typed a lot in a TextBox, but because the TextBox was for a file path and a very long file path was inserted into it.

The source of this problem was that we had the TextBox in a ScrollViewer with the HorizontalScrollBarVisibility set to "Auto". Changing HorizontalScrollBarVisibility to "Disabled" caused the TextBoxes to stop expanding with typing. The TextBox will still resize as expected (because of the Grid it is in) when the Window resizes.

This entry was posted in srt, WPF. Bookmark the permalink.

4 Responses to WPF LL: TextBoxes that just keep growing

Comments are closed.