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

  • Thread starter Thread starter Guest
  • Start date Start date
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....
 
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
 
Back
Top