home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 10,255 of 10,840   
   Ralph to Raoul Watson   
   Re: Detecting open forms   
   12 Oct 06 07:29:30   
   
   From: nt_consulting64@yahoo.com   
      
   "Raoul Watson"  wrote in message   
   news:B7fXg.3279$HP.1206@trndny08...   
   > I have a form which should not be opened concurently with another form. Is   
   > there a way to detect if a form is already open? I cannot use the   
   statement:   
   >   
   > If Form1.Visible = True then ..   
   >   
   > because this statement actually will LOAD Form1 which is not what I want   
   to   
   > do.   
   >   
   > I can of course use a global variable as a flag to indicate a form is open   
   > and reset the flag on form unload and simply test for this flag, but any   
   > alternative or idea is greatly appreciated.   
   >   
      
   I rather prefer Karl's suggestion, but an alternative is to have each Form   
   define a common Mutex. Each form checks the Mutex on loading, if already   
   defined it exits.   
      
   -ralph   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca