Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MDI forms

Posted on 2000-05-08
3
Medium Priority
?
269 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 150 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Suggested Courses
Course of the Month12 days, 21 hours left to enroll

972 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