Solved

MDI forms

Posted on 2000-05-08
3
261 Views
Last Modified: 2010-04-04
I need a way, knowing the MDI child caption to bring it to top of wall the other MDI childs.

Thanks
0
Comment
Question by:lfrodrigues
3 Comments
 
LVL 5

Accepted Solution

by:
TheNeil earned 50 total points
ID: 2788188
Iterate through the MDIChildren array looking for the caption that you want and then activate the form:

FOR n := 0 TO (MDIChildCount - 1)
DO
  IF MDIChildren[n].Caption = sFindName
  THEN
    MDIChildren[n].BringToFront;

The Neil =:)
0
 
LVL 7

Expert Comment

by:Motaz
ID: 2788220
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
0
 
LVL 1

Author Comment

by:lfrodrigues
ID: 2792440
Thanks TheNeil
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now