WPF Editable Combobox IsFocused Task

I am developing a Watermarked ComboBox by modifying the ComboBox ControlTemplate . Everything is fine when the ComboBox not in editable mode, but when I change the editing mode to True, the IsFocused property is never set to True. This is due to the fact that in the editing mode of the ComboBox , a TextBox used. This is an exact duplicate of this question https://stackoverflow.com/a/414829/ There are no answers to this question.

Please leave a line if you know how to solve it, or point me to the links that provide the Watermark ComboBox implementation. Thanks, Rey.

+7
wpf combobox focus
source share
2 answers

You can try using IsKeyboardFocused or IsKeyboardFocusWithin instead

+8
source share

Try using the IsFocused or IsKeyboardFocused or IsKeyboardFocusWithin properties of the TextBox that is inside the ComboBox. TextBox can be found in e.OriginalSource (property TextChangedEventArgs).

It worked for me.

0
source share

All Articles