Solved

MDI forms

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

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

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…
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…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

617 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