Link to home
Start Free TrialLog in
Avatar of cooldude77
cooldude77

asked on

in a very difficult situation now..

i have to keep track of the number MDI child forms
in my MDI master forms..i tried using MDIChildCount
but it does not work correctly..
my toolbar buttons are not disable propertly..when
the num of MDI child forms are decreased...
the logic: if no MDI child forms..disable save, print buttons..
if have mdi child forms..enable save, print, buttons...
can someone pls give me some sample code to how this is done? thanx a lot..
ASKER CERTIFIED SOLUTION
Avatar of inter
inter
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cooldude77
cooldude77

ASKER

Screen.OnActiveFormChange := UpdateToolbarAndMenu;
where do i put this? under mainform.create or mainform.new1click?
new1click is creating a new file..
i tried yr method oledi..
still has  a bug disenabling the buttons after no
MDI child forms exist...
if i create a counter i don't use MDIChildCount..how do i do it then?
You should place is in MDI master FormCreate method.

By the way what version of Delphi are you using?

Igor
i put it under formcreate and it works sometimes..and somes it does not work..
i am using delphi 3 pro
if i use a var to count the mdi child forms created and destroy..
will it work?
 my problem lies in having
SpbtnSave.Enabled := MDIChildCount > 0,
 when closing all forms -that is no child forms exists in
the MDI master form,
my MDIChildCount is still "1" so the buttons get enabled..
is there a way to correctly detect MDIchildCout?
If the project does not contain a KNOWHOW please zip it and send it to me. Or delete some parts and send! (for you privacy)

Then list the modifications you want I DO THEM FOR YOU! Offer a points for this and DO THIS friend. This may be better for both you and me. List all the things and combine all your other questions. I analyze the program and detect how MDIChildCOunt be 1 even if there is no child! (Actually you can, just check MDIChilds[0].Name if it is not empty you have an MDIChild still hiding somewhere...etc..

THERE IS ALWAYS A WAY -WEIRD, DIRTY OR CLEAN- DONT WORRY
Igor
BTW

please if you can delete your toolbar buttons etc. I dont mean to steal them but be comfortable.

Igor
inter@kosgeb.tekmer.gov.tr