7

I am developing a Watermarked ComboBox by modifying the ComboBox ControlTemplate. Everything is fine when the ComboBox is not in an editable mode, but when I change the edit mode to True, the IsFocused property is never set to True. This is because in edit mode, the ComboBox is using a TextBox. This is an exact copy of this StackOverflow question: . There are no responses to that question.

Please drop a line if you know how to solve this, or please point me to links that provide a Watermark ComboBox implementation. Thanks, Rey.

Community
  • 1
  • 1
Manohar
  • 293
  • 1
  • 5
  • 16
  • possible duplicate of [How to add a focus style to an editable ComboBox in WPF](http://stackoverflow.com/questions/1543804/how-to-add-a-focus-style-to-an-editable-combobox-in-wpf) – Gilles 'SO- stop being evil' Sep 06 '11 at 16:49

2 Answers2

10

You could try to use the IsKeyboardFocused or IsKeyboardFocusWithin instead

Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758
0

Try using the IsFocused or IsKeyboardFocused or IsKeyboardFocusWithin properties of the TextBox control which is within the ComboBox control. The TextBox can be found at e.OriginalSource(TextChangedEventArgs property).

It worked for me.