Autor Beitrag
polysign
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Mo 06.12.04 14:12 
Hallo, hab ein Programm was folgendes beinhaltet.
Ein MDIForm was ein anderes MDIChild aufruft. Auf dem MDIChild ist ein Button was wiederum ein einfaches Formular mit ShoModal aufruft. Meine Frage ist nun, ob es möglich ist vom einfachen Formular auf das MDIChild zurückgreifen was das Oeffnen des normalen Forms ausgelöst hat???

Wenn mir jemand helfen könnte were schon nett. Es geht auch ohne, aber ich versuche hier noch was zu optimieren ;)

Danke
Maa83
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

Win XP Pro
D6 Ent
BeitragVerfasst: Mo 06.12.04 14:47 
könntest du das bitte nochmal erklären! Einfaches Formular, Normales Formular !?! Was ist denn was?
und was meinst du mit zurückgreifen?
herzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 168

WINXP pro, SUSE Linux 9.0
D7 Pers.
BeitragVerfasst: Mo 06.12.04 14:57 
Normales Formular zur Laufzeit erzeugen.

Im ChildWin uses erweitern um die Formular-Unit

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TMDIChild.Button1Click(Sender: TObject);
var
  x:TForm1;
begin
  x:=TForm1.Create(Parent,self);
  x.Show;
end;


Und im Standard-Formular dann
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:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;

  private
    { Private-Deklarationen }
  public
    constructor Create(AOwner, Caller: TComponent); Overload;
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
implementation

{$R *.dfm}

uses ChildWin;

constructor TForm1.Create(AOwner, Caller: TComponent);
var
  childform:TMDIChild;
begin
  Create(AOwner);
  if Caller.ClassType=TMDIChild then begin
    childform:=TMDIChild(Caller);
    ShowMessage(childform.Memo1.Text);
  end;
end;

end.
polysign Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Mo 06.12.04 15:36 
Danke für die Hilfe, hat sich aber mit (frmMain.AciveMDIChild as TfrmOverview).lbSQL...... erledigt... danke trotzdem!!!