By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,887 Members | 1,170 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,887 IT Pros & Developers. It's quick & easy.

Activating Windows Forms

P: n/a
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

Feb 16 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

si***********@yahoo.com wrote:
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

Feb 17 '06 #2

P: n/a
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.

Feb 17 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.