I have an application with a ChildWindow (Toolkit V3.0) containing a TextBox. I want the TextBox to have Keyboard focus when the ChildWindow is opened (when Show() is called).
In XAML, I set FocusedElement to the TextBox. This resulted in the TextBox showing as having logical focus, but it did not have Keyboard focus (Cursor was not active in the TextBox).
In code behind, I called Keyboard.Focus(textbox) immediately after calling Show() on the ChildWindow. This ALMOST works.
The first time I Show the ChildWindow after starting the application, the TextBox does NOT have focus.
However, the next time I Show it, and all subsequent times, the TextBox properly has Keyboard focus.
Does anybody have an idea what could be causing this behavior? Any ideas how to eliminate it?
Thanks,
Bill
In XAML, I set FocusedElement to the TextBox. This resulted in the TextBox showing as having logical focus, but it did not have Keyboard focus (Cursor was not active in the TextBox).
In code behind, I called Keyboard.Focus(textbox) immediately after calling Show() on the ChildWindow. This ALMOST works.
The first time I Show the ChildWindow after starting the application, the TextBox does NOT have focus.
However, the next time I Show it, and all subsequent times, the TextBox properly has Keyboard focus.
Does anybody have an idea what could be causing this behavior? Any ideas how to eliminate it?
Thanks,
Bill