Opening one form from another

  • Thread starter Thread starter MJ
  • Start date Start date
M

MJ

I have an application with 2 forms (formMain and formTools)
formMain contains a button which if clicked opens formTools using
..show(this)
This works fine as when open formTools is over FormMain and you can still
select both forms.
My problem is that I want o prevent the used opening the formTools form more
than once.
I cannot use a modal form as I still want to be able to use both forms when
they are open.

Thanks in advance.
MJ
 
MJ,

Have a field storing the reference to formTools in formMain. When you
click the button, check the field. If the field is not null, then just do
nothing (or bring the form to the front).

If the field is null, then create a new instance of the form and store
it in the field. Also, add an event handler to the formTool's Closed event
to a method that will set the field to null when called.

Then just show the form.

Hope this helps.
 

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

Back
Top