Link to home
Start Free TrialLog in
Avatar of lfrodrigues
lfrodrigues

asked on

MDI forms

I need a way, knowing the MDI child caption to bring it to top of wall the other MDI childs.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of TheNeil
TheNeil

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

See this code:

procedure TForm1.Display1Click(Sender: TObject);
var
  Cap: string;
  i: Integer;
begin
  Cap:= InputBox('', '', '0');
  for i:= 0 to Form1.ComponentCount - 1 do
    if Form1.Components[i] is TForm then
      if  (Form1.Components[i] as TForm).Caption = Cap then
        (Form1.Components[i] as TForm).SetFocus;

end;


Form1 is the MIDI form
Form2 is the child form

Cap the caption that you want it's Form to be activated.

Motaz
Avatar of lfrodrigues

ASKER

Thanks TheNeil