AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Zugriff auf Formular währen OnShow

Ein Thema von striderx · begonnen am 24. Apr 2015 · letzter Beitrag vom 24. Apr 2015
 
Popov
(Gast)

n/a Beiträge
 
#4

AW: Zugriff auf Formular währen OnShow

  Alt 24. Apr 2015, 21:05
Nochmal mit Quellcode:

Projektdatei
Delphi-Quellcode:
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas{Form1},
  Unit2 in 'Unit2.pas{Form2};

{$R *.res}

begin
  Form2 := TForm2.Create(Application); //rein

  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  //Application.CreateForm(TForm2, Form2); //raus
  Application.Run;
end.
Unit1/Form1 (Zugriff auf eine Komponente in Form2 bereits in Create von Form1)
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
  ShowMessage(Form2.Edit1.Text);
end;
Oder, wie himitsu meinte:
Projektdatei
Delphi-Quellcode:
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas{Form1},
  Unit2 in 'Unit2.pas{Form2};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  //Application.CreateForm(TForm2, Form2); //raus
  Application.Run;
end.
Unit1/Form1
Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
  Form2 := TForm2.Create(Application);
  ShowMessage(Form2.Edit1.Text);
  //Form2.Free; //wenn man es nicht mehr braucht
end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:42 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz