I am sorry to ask such a seemingly abcd question but I have been trying in vain to hide/show forms. Also my main menu is made up of two forms, a main menu form is a central window, devoid of title bar, minimize, maximize and is mostly commands on a picture background. Then there is a black background form with some big text to cover the desktop, hence to assure that the desktop background don't interfere with the color picture/theme of my main menu. When the user click the first option and a new form appearing, I have difficulty hiding the main menu form and when I click somewhere in the background form, the active form just dissappear, actually it moves behind the background leaving the user with a black window.
Could anybody help on this???

2 answers
You need to keep a handle on your background window so that you can manage it. A good way to do this that I use is to make the form instances public in the static Program class. Here's an example of how this might work:
Then in your main menu form, you can just do something like:
To prevent the background form taking focus when it's clicked, you can add something to its Click event. It's crude, but it should do the trick...
Make sure also that your background form is not selectable in alt-tab nor does it show up in the taskbar. This prevents getting to it via the keyboard - at least easily.
A more elaborate way to do this would be by using an MDI application, and having an MDI parent form that houses the main menu as a child window. MDI forms naturally cannot have exclusive focus to the point of hiding all their child windows.
The background form will be automatically killed when you close the main form, since you executed Application.Run against the main menu form. You could of course also do it the "clean" way and manually issue "Program.bkg.Close()" on the background form when your program is exiting.
fm
answered one year ago by:
490
30
Thank you very much. This and a new print out documents on form will assuredly help me. I am going to work out the shell of my program then I will be back to you. Thank you. From Nic.
30
hi, I have been unable to make the above program work. I believe that I must have wrongly placed the code. Could you please guide me to where should the code be pasted??? Thanks.
Well, here is a mock up of what a funtion to do this would be:
Hope this helps!
answered one year ago by:
61