Activating Windows Forms

  • Thread starter Thread starter simchajoy2000
  • Start date Start date
S

simchajoy2000

Hi,

Let me see if I can explain this, I have noticed that when I create new
windows forms (within my larger window form which serves as the primary
interface with dropdown menus etc) that sometimes you can activate more
than one window at once if you click back and forth enough. Normally I
wouldn't care but it actually causes me huge problems down the line
because when I try to get the ActiveMdiChild.ActiveControl it could be
either of the two forms which are active. My code assumes that this
can not happen so a whole bunch of things break.

Is there a way to make sure that all the other windows get disactivated
when one is activated?

Any suggestions? Thank you!

Joy
 
You just have to verify which form is actually active prior to doing
anything with it. This is the envrionment in which you program. Your
code's assumption is wrong - never assume anything!

Tom
 
No I do check to make sure the form is active before doing anything -
the problem is there are two forms active at one time.
 
Back
Top