I am working with editable combobox where text can be entered in the textbox area of WPF combobox. When the length of text entered is greater than the width of combobox, the cursor still shows outside the combobox and on the form but text is not shown. Is there anyway to restrict the cursor from not moving out of the combobox?
Thanks.
Use ScrollViewer for PART_ContentHost instead of border. For example:
<ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
<ScrollViewer x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" />
</ControlTemplate>
...
<TextBox x:Name="PART_EditableTextBox" Style="{x:Null}" Template="{StaticResource ComboBoxTextBox}"
...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With