Quantcast
Channel: wpftoolkit Discussions Rss Feed
Viewing all articles
Browse latest Browse all 2157

New Post: ChildWindow FocusedElement not working as expected

$
0
0
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

Viewing all articles
Browse latest Browse all 2157

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>