1

I have a TextBox that stretches to the width of the window:

<Window ...>
    <TextBox VerticalAlignment="Top" />
</Window>

However, the textbox should have a minimum width, and I want scroll bars to be shown, if the textbox cannot be displayed fully. Thus:

<Window ...>
    <ScrollViewer HorizontalScrollBarVisibility="Auto">
        <TextBox MinWidth="200" VerticalAlignment="Top" />
    </ScrollViewer>
</Window>

This, however, has a negative side effect. If the user enters more text than fits into the text box, the text box increases its size:

alt text http://img85.imageshack.us/img85/8093/33086888.png

Is there a way to avoid this effect and still have the scroll bars if the minimum size of the textbox is reached?

Heinzi
  • 167,459
  • 57
  • 363
  • 519

0 Answers0