Autor Beitrag
PeterKiers
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26


D7
BeitragVerfasst: Mi 31.08.05 18:25 
Hallo zusammen!

ich bin absoluter Delphi Anfänger und hab nun ein kleines Problem das ich einfach nicht lösen kann. Hab auch hier im Forum schon gesucht jedoch nichts gefunden.

Wie kann man Feststellen ob ein bestimmtes MDICHild gestartet ist ?

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
procedure TForm1.Timer2Timer(Sender: TObject); 
begin 
  inc(i); 
  if i > 6 then i := 1; 
  case i of 
    1: begin 
        if MDIChildren[i].ClassName = 'TForm2' then 
        begin 
          Statusbar1.Panels[0].Text := (' Checking AS4SV001 ...'); 
        end; 
      end; 
    2: begin 
          if MDIChildren[i].ClassName = 'TForm3' then 
        begin 
          Statusbar1.Panels[0].Text := (' Checking AS4SV005 ...'); 

        end; 
      end; 
    3: begin 
        if MDIChildren[i].ClassName = 'TForm4' then 
        begin 
          Statusbar1.Panels[0].Text := (' Checking AS4SV006 ...'); 

        end; 
      end; 
    4: begin 
        if MDIChildren[i].ClassName = 'TForm5' then 
        begin 
          Statusbar1.Panels[0].Text := (' Checking AS4SV007 ...'); 

        end; 
      end; 
    5: begin 
        if MDIChildren[i].ClassName = 'TForm6' then 
        begin 
          Statusbar1.Panels[0].Text := (' Checking AS01DUO1 ...'); 

        end; 
      end; 
    6: begin 
        if MDIChildren[i].ClassName = 'TForm7' then 
        begin 
          Statusbar1.Panels[0].Text := (' Checking AS02DUO1 ...'); 

        end; 
      end; 
  end; 
end;


Im voraus schon mal vielen Dank.

Gruss

Peter

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
MisterBum
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 107



BeitragVerfasst: Mi 31.08.05 18:32 
Versuchs mal mit dem Befehl: Assign

Schau am besten mal in der Hilfe, ich bin mir nicht ganz sicher, aber glaub dies mal dafür verwendet zu haben...
PeterKiers Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26


D7
BeitragVerfasst: Mi 31.08.05 20:00 
Es functioniert mit:

ausblenden Delphi-Quelltext
1:
2:
if (FindComponent('Form1') <> nil) then 
  ShowMessage('Form1 ist geöffnet');


Peter Kiers

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Do 01.09.05 11:20 
Das Hauptfenster hat die Eigenschaften MDIChildCount und MDIChildren. Mit Hilfe dieser Eigenschaften kannst du alle MDI Child Fenster in einer Schleife durchgehen und prüfen ob darunter sich ein Fenster von einer bestimmten Klasse befindet.

Lg Martin