Setting focus to a form based on a form handle ( C# )

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi! I maintain a collection of all form handles that I span out.
The forms can be MDI Parents or Children - my app opens up
several forms of different type. Once in a while, when a user
performs an action that opens up a new form, I want to check first
if the form is already opened and if so, just set the focus to that form.
Is there an API call that can do that ? I can not find anything in managed
code. May be I am not looking right ?

Please let me know if you've done similar things.

Many Thanks,

--Mike
 
Mike,

You can enumerate existing forms and check the state (Visible, Enabled) and
decide what to do using OwnedForms property. If form is MDI you can find
this out using IsMdiContainter and enumerate children too using MdiChildren.
So, I am not sure, what exacty you do miss?

HTH
Alex
 
Hi! Unfortunately, handles are the only way to track forms in this application.
It's a long story involving 3rd party components. So, what's the best way to
set focus to a form based on its handle ?
 
Back
Top