How can i prevent a form to be open few times?

G

Guest

hello,
i have a mainForm that has few buttons which open different forms.
how can i prevent a form that is already open to be open again ( i don't want to close the mainForm)?

thanks....
 
C

Cliff Harris

Within your main form with the buttons, you could keep a reference to the
other forms that you want to open with the button clicks. Then, when the
button is clicked, check to see if the form reference has been initialized,
and if not, create a new one, otherwise, just give that form the focus.

HTH,
-Cliff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top