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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MDI Application 1

Status
Not open for further replies.

indrahig

Programmer
Mar 23, 2004
63
ID
Hi,
Is there any ways to show second Child Form from First Child Form in MDI Application, so that the First Child will be temporary disable until the second one closed? And still can access other child form (except the First one) in that application..
Any help will be appreciated.. thanks
 
If you remove the creation of the second form from the projects source code, you can then place a button on your first child form which, when clicked creates the second child form and activates it.

[blue]A good friend will come and bail you out of jail, but a true friend will be sitting next to you saying "Damn that was fun!"[/blue]
 
sorry for accidentally post this twice..

thanks EricDraven, but that not what I mean..
What want is: after the second form created at run time, I want the first one to be temporary disabled (cannot get focused from any user input) until the second one closed..
 
By the first form, do you mean the Main parent form or do you have a Main Form, first child form and then second child form? You should be able to set any form to enabled true or false but you will have to shift the focus first as obviously, you cannot focus a disabled object.

[blue]A good friend will come and bail you out of jail, but a true friend will be sitting next to you saying "Damn that was fun!"[/blue]
 
Put the second form on fsStayOnTop and disable the first one.

That should do it,

[bobafett] BobbaFet [bobafett]

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
 
to explain my code: that would be
Form1.Enabled := False;
Form2.FormStyle := fsStayOnTop;

[bobafett] BobbaFet [bobafett]

Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
 
I have a Main Form (MDI form) and let just say two kind of MDI child forms. After I create the first one (MDI child), then with a click of a button, the second type of MDI child will be created. I want the first child to be disabled and wait until the second one is closed. I already try to disabled the first one, but how to make it wait until the second child is closed. I guess we're getting clear about this. Thanks..
 
dont know what you mean bu make it wait.
all open mdi forms will wait behind the topmost (active) form.

if bobbafet's code worked

Form1.Enabled := False;
Form2.FormStyle := fsStayOnTop;

then add to form2 onclose event
Form1.Enabled := True;

Aaron Taylor
John Mutch Electronics
 
what about form2.showmodal ???
this will disable all other forms till its closed.

i cant remember if showmodal will work on mdi's
give it a go..

Aaron Taylor
John Mutch Electronics
 
thanks, Aaronjme and BobbaFet.
Yes, what I mean by the first one is waiting is the behavior like ShowModal does.
But I've already tried to use ShowModal. It raised error "cannot make visible window modal". I tried BobbaFet suggestion too, but the second one is not an MDI child anymore, I want it still to be an MDI child.
So I want the behavior like ShowModal, the first one will be lost its focus until the second one is closed, but in MDI. Can it be done?
 
An MDI child visible property is always True. And if you try to change it, an error message will be appear: "Cannot hide an MDI Child Form".
 
you can.

in the forms onclose event you set action to caHide or somthing, not sure till i get home, if someone else doesnt post an example i will do it tonight for u.

Aaron Taylor
John Mutch Electronics
 
nice sample aaronjme!
You did inspire me.
Thanks, and a star for you.
The problem I'm dealing with is far more complex than that, but your sample has just opened the door to the enlighment I seek..[bigsmile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top