Autor Beitrag
Coolman1974
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Sa 25.06.05 20:12 
Hallo ihr!

Ich habe folgendes Problem:
Form1(MDI-Form), Form2(MDI-Child), Form3(MDI-CHild).

Auf den Formularen 1 bis 2 befinden sich einige Editboxen.

Auf dem Formular 1 befinden sich 2 Button die zum öffnen der MDI-Child-Fenster zuständig sein sollen. (was auch funktioniert).

Beispiel:

In der .pas Datei der Form1 will ich die Editbox1 auf der geöffneten Form2 ansprechen und ihr einen String übergeben, wie z.B: Form2.Edit1.Text := 'Test';

Selbstverständlich bedindet sich die Form2 .pas Datei in dem implementation-Bereich.

Also, wenn ich so vor gehe, dann bekomme ich immer eine Zugriffsverletzungsmeldung.


Hat jemand eine Idee ?


Bin euch jetzt schon dankbar.

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt.
ebs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Sa 25.06.05 20:48 
Schick mal ein bisschen Quelltext! 8) Ich glaube, dass wir dir dann besser helfen können.
Aber eigentlich sollte das so gehen.
ebs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Sa 25.06.05 20:49 
Aßerdem glaube ich, dass das unter Sonstiges nichts zu suchen hat 8)
JayK
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1013



BeitragVerfasst: Sa 25.06.05 20:50 
user profile iconCoolman1974 hat folgendes geschrieben:
Selbstverständlich bedindet sich die Form2 .pas Datei in dem implementation-Bereich.

Du meinst den uses-Klausel, oder?

user profile iconCoolman1974 hat folgendes geschrieben:
Also, wenn ich so vor gehe, dann bekomme ich immer eine Zugriffsverletzungsmeldung.

Wie erstellst du denn die Child-Forms? Code bitte... (von den ganzen Prozeduren)
Coolman1974 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Sa 25.06.05 21:15 
Ok, ein wenig Code!

Diese Prozedur existiert noch zweimal, für die anderen Forms.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.fcOutlookBar1OutlookList1Items1Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
begin
  aForm3 := TForm3.Create(self);
  aForm3.Show;
end;


Diese Prozedur befindet sich ebenfalls auf Form1 und wird ausgeführt wenn ich einen Menüpunkt in der Memüleiste betätige. (Also Form1 ist offen, Form3 ist offen)
ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Hilfe1Click(Sender: TObject);
begin
  Form3.txtArbeitsgruppe.Text := '123';
end;


Wenn ich also auf den Menüeintrag klicke sollte eigentlich '123' in der Textbox auf Form3 erscheinen, aber ich bekommen eine Zugriffsverletzung.

Ich hoffe, das ist etwas deutlicher ?
ebs
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 213

Suse Linux 9.2, Win 98, Win NT, Win XP, Win for Workgroups, Win XP SP2, Dos 6.1
D3 Prof, D2005 PE, Delphi 2006 Prof.
BeitragVerfasst: Sa 25.06.05 21:44 
So sollte es halt eigentlich gehen, allerdings glaube ich, dass nochmehr Text benötigt wird, um eine genaue Aussage zu geben. 8) :D
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Sa 25.06.05 22:15 
Wieso heist es im ersten Codeschnip "aForm3", und im zweiten "Form3"?
Coolman1974 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: So 26.06.05 16:45 
Dank euch für eure Hilfe, aber ich bin selber drauf gekommen.

Ich öffne und schließe die MDI-Childs jetzt mit

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
 
procedure TForm1.fcOutlookBar1OutlookList1Items0Click(
  OutlookList: TfcCustomOutlookList; Item: TfcOutlookListItem);
var
  I: Integer;
begin
  with Form1 do
    for I := MDIChildCount - 1 downto 0 do
    begin
      MDIChildren[I].Free;
    end;
    Application.CreateForm(TForm2, Form2);
end;


so klappts !!! :lol: