If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

WPF Window.Activate() Returns False

Hi all,

We've got an application that, when started, displays a login window. We'd like the window to be the active window, and the focus to be on the username textbox. We call the Activate() method in our overridden OnContentRendered method, which works fine most of the time, but sometimes it fails, and returns false. In particular, it seems to always fail on virtual machines. In cases where it fails, the application doesn't have focus (even if we set up our Login form to be top most) but the button in the task bar flashes.

Does anyone know what might cause the Activate() method to return false ?

Re: WPF Window.Activate() Returns False

The dialog IS modal (we use ShowDialog() ), so maybe also setting it top most was a bit overkill, but since we were having focus issues, we threw everything we could think of at it. I believe NOT making it top most doesn't fix the issue anyway.