Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restoring Focus on Common Dialog when switching apps

Status
Not open for further replies.

yumbelie

Programmer
Dec 31, 2002
96
0
0
GB
Hi,
I have an MDI window, which has a number of forms within it. If one of these forms calls a common dialog (for example to search for a file), and then decides while the common dialog is open to switch Applications (e.g. to Windows Explorer etc) and then switches back, the focus is lost on the common dialog. The user must alt-tab to select the common dialog in order to be able to interact with it and restore focus to the MDI dialog that called it. Is there any way in which I can automatically restore focus to the common dialog if the user decides to switch to another application, and then switch back?

thanks

Yum.
 
I would say that the answer to your question is yes. Try coding a gotFocus event handler for the form that checks if the common dialog is still displayed, and if so set the focus to it (or one of it's controls).

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top