Solved

MDI forms

Posted on 2000-05-08
3
266 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

751 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