Determine Which Form You Have Lost Focus To

  • Thread starter Thread starter Mark Ingram
  • Start date Start date
M

Mark Ingram

Hi,

ive just had to make a Find dialog for an application and to get it in a
similar style to the MS ones i have had to set the control style to TopMost
so that i can move the caret around whilst the find dialog is open. However
i want to know when i lose the focus, if it ISNT the form that called my
find dialog, i want to change the topmost style to a normal style so that it
wont be displayed on top of the other form.
Does that make sense? If there is a better way of howto go about doing that
doesnt hesitate to mention it.

Thanks

Mark
 
Mark Ingram said:
Hi,

ive just had to make a Find dialog for an application and to get it in a
similar style to the MS ones i have had to set the control style to TopMost
so that i can move the caret around whilst the find dialog is open. However
i want to know when i lose the focus, if it ISNT the form that called my
find dialog, i want to change the topmost style to a normal style so that it
wont be displayed on top of the other form.
Does that make sense? If there is a better way of howto go about doing that
doesnt hesitate to mention it.

Thanks

Mark

I would check to see if one of the overloaded methods of ShowDialog couldn't
be used to make the framework do that for you. Then you pass a reference to
the form when you show the find box using .ShowDialog. Anyway, I haven't
done it, just that I'd look at that.

HTH,
Eric
 
I think you have mis-understood what i meant. Using ShowDialog() will not
allow any focus on the form that called the dialog, my needs are to allow
focus on that form, and that form only. In effect, opposite of the
ShowDialog() function. If i change focus to say outlook from my app, it
should stop the find dialog from being top most.

Look at notepad, see how when you open up the find dialog box it allows you
to carry on working in the background of notepad? That is what i want to
implement.

Cheers

Mark
 
Back
Top