PROBLEM:

You can get the Combobox Style and template XAML from http://msdn.microsoft.com/es-es/library/ms752094(v=vs.85).aspx

As in XAML, ControlTemplate for ComboTextBox sets to be TextBox. For some reason, when lenght of the text input is greater than the width of the textbox, the entire text remains visible and runs out of the textbox. I was expecting the input text to scroll and remain within the textbox. This was really annoying.

SOLUTION:

Hence to resolve this issue, XAML was modified as below

Border control is replaced by ScrollViewer that scrolls the text as input text length is greater than textbox width.

Hope this helps if you encounter similar issue.

Happy Coding..

WPF: Extending combobox to take text without overflowing the control
Tagged on:

One thought on “WPF: Extending combobox to take text without overflowing the control

  • April 9, 2013 at 6:47 pm
    Permalink

    This fix is a lifesaver!!! LITERALLY. It isn’t perfect though. When the text is longer thant the textbox, it scrolls to the end of the text. Is there a way to tell it not to do that?

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *