Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Form / Close program questions?

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I hope what I'm wanting to do is possible (and if it's easy EVEN BETTER!).

1. Open Form: I have my main form that has a menu across the top of it (and that's it!). How can I design/program a form to open in the "blank space" of the main form so that the menu is still shown at the top?

2. Close Program: I have found in testing that if I accidently click the mouse on the main form when I have a form open (using Form.Show) the main form comes to the front, the open form disappears, and when I end the program I get exception errors (I figure because the other form is still open!). What can I do to return to the open form?

Thanks!

Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
I'm not sure if this is what you need, and I haven't used this feature, but I think what you want is an MDI form. You can try this with the formstyle property of a form, making one a parent and one a child.
 
I tried that but then it creates the child form at start up (even though I think it wasn't included in the autocreate list) and then when I tried to close it, it just minimized into the corner of the main form. Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
An MDI parent/child form sounds like what you need. For the other one, open it with ShowModal. Then no other form in the app can take the focus until it is closed.
 
lespaul this should help

go to this thread
thread102-360582 Anywhere is walking distance if you have the time.
 
MDI clild forms can't close by default (it will just minimise as you saw) you need to set
action := cafree; in the close method.
Canclose must also be true but should be by default
Steve.
 
You could just set the Parent property of each new form to the main form...
 
Also, I'd set the owner of each new form to be the main form too. I think that would do what you want.
 
To close all forms when one is closed just use application.terminate in the OnClose event. Works for me, but it doesn't give you too much control over what happens (or it does and I just don't know).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top