none
Hiding a form

    Question

  • Yesterday, with help here, I figured out how to move between projects in a solution.  Very cool.

    So what I have is a set of projects (call these sub projects), each containing a menu form (call them a mnuProject) to drive the applications/events within that project.  There is one project (call that project Alpha) that has a menu form that is setup to open the menus of any of the sub projects selected in this project menu (let's call this mnuMain).  It took all day yesterday, but it is working beautifully.  Now comes the tricky part that I am unable to figure out.

    I want to hide mnuMain when another sub project mnuProject is called, then when I exit the mnuProject, mnuMain will be re-opened (in-hid).

    As you might expect, the results are less than I had intended.  I attempted using the Me.Hide() prior to calling a mnuProject, and this works up to the point where I close the mnuProject to return to mnuMain.  Basically, mnuMain does not reopen and I am left hanging with an open application and no mnuMain form to be used.

    Assuming you can understand my description of the events, is there anyone who might be able to point out to me how this would/could be achived?


    gwboolean

    Tuesday, April 18, 2017 4:11 PM

All replies

  • I want to hide mnuMain when another sub project mnuProject is called, then when I exit the mnuProject, mnuMain will be re-opened (in-hid).

    You are using separate executables but trying to treat them as a single program, and that is going to be complex.  Your simplest option is to minimize mnuMain and let the user restore it when they need to select another option.  Or, you could close mnuMain and restart it from mnuProject just before mnuProject closes.

    Otherwise you will need to use some form of interprecoess communication. See:
    https://msdn.microsoft.com/en-us/library/windows/desktop/aa365574(v=vs.85).aspx

    Tuesday, April 18, 2017 9:41 PM
  • Yeah, I have already tried several approaches, including the reverse of what I have already done with the sub projects I already have.  It appears to me that when you do this, the load event is not re-executed on the return trip.  Anyway, it was a thought.  I will have a look at the links you have to see whether the effort is worth the input to get there.  Thanks.

    gwboolean

    Tuesday, April 18, 2017 10:07 PM
  • It appears to me that when you do this, the load event is not re-executed on the return trip.

    When you do what?  The load event will be executed when the form loads. If the load event is not executing then you aren't actually loading the form.   If the user is restoring the form then there is no need for the load event to execute.  It's not clear which of the available procedures you are referring to.

    Tuesday, April 18, 2017 10:10 PM