Solved

MDI forms

Posted on 2000-05-08
3
264 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LAN or WAN ? 11 95
Multiple image collision 13 80
Controlled Assessment GCSE - desperate help needed 4 102
TEMBEDDEDWB how can i change its user agent ? 8 69
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

856 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