|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Activating Windows FormsHi,
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 simchajoy2***@yahoo.com wrote: Show quoteHide quote >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 > > > 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.
by default, public or private?
Getting current user name Reference to a variable need help on DateDiff function! Getting Color Depth / Quality of display adpater / screen Treeview, Which collection object to use similar to SortedList\Hashtable BindingSource.AddNew Properties of a Property Property of List of Classes |
|||||||||||||||||||||||