unhiding the parent form

Ok, so i have a j# application form that is started with:
Application.Run(
new form_splash());

I'm trying to open up a new window with the following code in a click event on a button.

form_main window = new form_main();
Hide(); //hide splash window
window.Show(); //shift show and activate new window
window.Activate();

what can I do from the new form to shift focus back to, and un-hide the splash page The main problem I guess is that I dont know how to refer to the splash page.



Answer this question

unhiding the parent form

  • Mchafu

    Hi Brian,

    You need to set the owner of 'form_main' instance to 'form_splash' using below
    highlighted statement,

    ----------
    form_main window = new form_main();
    Hide(); //hide splash window
    window.set_Owner(this);
    window.Show(); //shift show and activate new window
    window.Activate();

    ----------

    From the main form, if you want to shift the focus back to splash page, you need to insert below statements in some control embedded on the main form - say for example you have added one button to the main form, on clicking this button you want the focus to shift back to splash page... insert below statements in button1_Click() method in main form,

    ----------
    Hide();
    get_Owner().Show();

    ----------

    Hope this helps you.

    Thanks,
    Kasinathan
    VJ# Team

  • jack zhao

    Perfect! thanks a bunch
  • unhiding the parent form