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


D7
BeitragVerfasst: Do 04.08.05 14:00 
Hi zusammen,

Ich hab eine letzte Frage!

wie kann man feststellen, ob ein bestimmtes MDI Child geöffnet ist?

Dieser Prozedure stimmt:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TMainForm.Connections(Sender: TObject);
begin
  if ConfigMan.CheckBox1.Checked = True
    then as4sv001(sender);
  if ConfigMan.CheckBox2.Checked = True
    then as4sv005(sender);
  if ConfigMan.CheckBox3.Checked = True
    then as4sv006(sender);
  if ConfigMan.CheckBox4.Checked = True
    then as4sv007(sender);
  if ConfigMan.CheckBox5.Checked = True
    then as01duo1(sender);
  if ConfigMan.CheckBox6.Checked = True
    then as02duo1(sender);
end;


Aber in dieser Prozedure müsste gekuckt werden ob der MDI Child
geöffnet is, und nicht if “ConfigMan.CheckBox1.Checked = True then”.
ich möchte zB so was wie

if ('TForm1' = Active ) then begin .....

ausblenden 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:
procedure TMainForm.Timer2Timer(Sender: TObject);
begin
  inc(i);
  if i > 6 then i := 1;
  case i of
    1: begin
        if ConfigMan.CheckBox1.Checked = True then
        begin
          Statusbar1.Panels[0].Text := (' Checking AS4SV001 ...');
          Form1.CopyAsText(nil);
          Form7.txtLog.Text := ' ';
        end;
      end;
    2: begin
        if ConfigMan.CheckBox2.Checked = True then
        begin
          Statusbar1.Panels[0].Text := (' Checking AS4SV005 ...');
          Form2.CopyAsText(nil);
          Form7.txtLog.Text := ' ';
        end;
      end;
    3: begin
            und so weiter...


Gruss Peter

Moderiert von user profile iconraziel: Code- durch Delphi-Tags ersetzt.
rochus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 416

Win XP Prof, Fedora Core 4, SuSE 7.0
D7 Ent, D2005 Pers
BeitragVerfasst: Do 04.08.05 14:06 
Hallo,
du kannst du die Geöffneten Formulare mit

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
for i:=0 to Screen.FormCount-1 do
begin
  if Screen.Forms[i] = YourForm then 
  begin
    { do something with form }
  end;
end;

{ oder }

for i:=0 to Screen.FormCount-1 do
begin
  if Screen.Forms[i].Class = TYourForm then 
  begin
    { do something with form }
  end;
end;


prüfen, ob was offen ist, das du willst.

_________________
Im Nachhinein ist man immer ein Schlauch!
"Dream as if you'll live forever, live as if you'll die today!" James Dean
noidic
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 851

Win 2000 Win XP Vista
D7 Ent, SharpDevelop 2.2
BeitragVerfasst: Do 04.08.05 14:09 
Schau mal in die OH unter ActiveMDIChild vielleicht hilft das weiter.

Übrigens ist die Bedingung

if Checkbox.checked = true

unnötig,

if Checkbox.checked

tut genau das selbe.

_________________
Bravery calls my name in the sound of the wind in the night...
rochus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 416

Win XP Prof, Fedora Core 4, SuSE 7.0
D7 Ent, D2005 Pers
BeitragVerfasst: Do 04.08.05 14:12 
Hmm muss mich korrigieren, hab nicht an MDI gedacht. Statt Screen.FormCount und Screen.Forms sollte man Formular.MDIChildCount und Formular.MDIChildren nehmen.

Gruß
Nicolai

_________________
Im Nachhinein ist man immer ein Schlauch!
"Dream as if you'll live forever, live as if you'll die today!" James Dean