Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: New Instance of a Form


Message #1 by "Niall Hannon (ext. 772)" <Niall.Hannon@f...> on Thu, 21 Nov 2002 10:10:21 -0000
Thanks for the replies - I am going to open these forms vbModal until I have
figured out what problems are there with these new instances. YOu know how
it is - just have to get the application up and running asap!

Thanks
Niall

-----Original Message-----
From: Marco Straforini [mailto:marco.straforini@c...]
Sent: 21 November 2002 20:16
To: professional vb
Subject: [pro_vb] RE: New Instance of a Form


I agree with Peter. Stay away from global objects.

If you need multiple instances of the form "Form1", never use the
default Form1 form in your code, but always

dim f as new form1
f.show

If you need to know if the form is already loaded, loop throw the
Forms collection

dim f as form
for each f in forms
  if typeof f is Form1 then
     '' an instance of form1 is alreay open
     exit for
  endif
next


Marco


**************************************************************************
The information contained in this e-mail is confidential,
may be privileged and is intended only for the use of the
recipient named above. If you are not the intended
recipient or a representative of the intended recipient,
you have received this e-mail in error and must not copy,
use or disclose the contents of this email to anybody
else. If you have received this e-mail in error, please
notify the sender immediately by return e-mail and
permanently delete the copy you received. This email has
been swept for computer viruses. However, you should
carry out your own virus checks.


Registered in Ireland, No. 205721. http://www.FINEOS.com
**************************************************************************


  Return to Index