Nonmodal user form focus

B

Bear

And while I'm asking questions about user forms with ShowModal set to False,
how do I detect when the user has activated another window (the user form has
lost focus) and when the user returns to the user form?

Bear
 
B

Bear

Jezebel:

(Word 2000, Windows XP)

Maybe I'm testing this wrongly, but putting a simple MsgBox in the Activate
and Deactivate events does nothing. Well, the activate message box is
displayed when the form is initially shown. But switching between the
document and the user form (by clicking in one or the other) has no effect.

What am I doing wrong?

Bear
 
B

Bear

Just to bring this thread up to date with what I've discovered.

There is no way to detect when a modeless userform gains or loses focus. I
found out how to determine the caption of the active window, using the
Windows API. But that's a far cry from a working activate and deactivate
event that treats the userform as a separtate window.

Bear
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top