WPF comes with an inbuilt feature of SpellCheck. SpellCheck is added to TextBoxBase object, which inherits all the textual input controls automatically. Thus any input control will automatically derive the Spell Checking functionality.
But I'm looking for a solution to set the spell checker for editable ComboBox which is not inherited from the TextBoxBase.Are there any way to set the spell check for Editable ComboBox controller ?
You will need to declare your own ControlTemplate for the ComboBox. In that ControlTemplate, you can start with the default ControlTemplate for the ComboBox, which you can find on the ComboBox Styles and Templates page on MSDN.
In the default template, you should see a TextBox named PART_EditableTextBox... as you might have guessed, this is the editable part of the ComboBox. Then all you need to do is to set the SpellCheck.IsEnabled Attached Property to True on it and apply your new ControlTemplate as your ComboBox.Template value:
<TextBox x:Name="PART_EditableTextBox"
SpellCheck.IsEnabled="True"
Style="{x:Null}"
Template="{StaticResource ComboBoxTextBox}"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Margin="3,3,23,3"
Focusable="True"
Background="Transparent"
Visibility="Hidden"
IsReadOnly="{TemplateBinding IsReadOnly}" />
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