Link to home
Start Free TrialLog in
Avatar of WizKid
WizKid

asked on

About MDI (Question 1)

I tried to add a TabSet to my MDI application and I want it in such a way that when I click on the TabSet, the corresponding MDI Child Window will be shown.

But I've noticed that the TabSet's Index and the MDIChildren array does not correspond (i.e. the index 0 in MDIChildren refers to the active Child Window but the index 0 in TabSet refers to the first Tab)

How do I solve this??

ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

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 WizKid
WizKid

ASKER

My Child doesn't have a menu...
So any other way??
Sorry, my mistake (how the hell to I come to menu???) Just call the tab to the name of your child name! Or define an array, where the corresponding numbers (tabs) have the name of your child.
Or just use something where you can store the name of the child to the corresponding tabindex. With the first example, you search through the list of names, if you found it you can go to the corresponding tabpage.
Doesn't example 2 works????
Hi WizKid,

look at this sample code :

http://torry.rimini.com/samples/samples/mddi1097.zip;

Sample of MDI with tabset, flickerless, ....

All what you need.

Merry X-Mas & Happy New Year!
Have fun,
c.u. ZifNab;
Avatar of WizKid

ASKER

Have already seen his sample code but it causes a runtime error when I click on my close all button

The piece of code for my close all procedure is as follow
procedure CloseAll;
var
  i : integer;
begin
  for i:=MDIChildCount-1 downto 0 do
    MDIChildren[i].Close;
end;
Have you put this into the OnClose event of the Childform('s)?

 Action := caFree;

This has to be done!.
Avatar of WizKid

ASKER

I've already done that...
When do you get the error?
At which i value? At beginning or end?
Avatar of WizKid

ASKER

I've solve it already...
Thanks for helping me all along :-)

WizKid
email: wenwei@mbox2.singnet.com.sg
webpage: http://web.singnet.com.sg/~wenwei/index.html