Autor Beitrag
TheBlackRave
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 29



BeitragVerfasst: Di 11.03.03 15:14 
Informationen übergeben!

Ich hab 2 TForm. Einer ist das Hauptprogramm das andere ist zur Einstellung eines Servers. Meine Frage ist jetzt wie kann ich eine Variable die ich in Hauptprogramm hab in der 2 Form benutzen? Dnake!
a.C.k
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 93

WIN 2000
Delphi 6 Enterprise ; Delphi 7 Studio
BeitragVerfasst: Di 11.03.03 15:21 
Deklariere sie im "Puplic" bereich:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
  TForm1 = class(TForm)
  ..
  ..
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }  
    Wert : String; //<- HIER!!!
  end;

implementation
..
..
..


Dann kanst du sie z.B. über "Form1.Wert" ansprechen.
Allerdings musst du Form1 (Namen der Unit... Unit1) in die Uses von Form2 eintragen.

ausblenden Quelltext
1:
2:
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, UNIT1 {<- HIER!};

_________________
Wer nicht gerne denkt, sollte wenigstens von Zeit zu Zeit seine Vorurteile neu gruppieren.