Autor Beitrag
Josef-B
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 293

2003 Server, Win7, Win8
Delphi 2010 Pro, Firebird 2.5
BeitragVerfasst: Mo 27.06.05 07:54 
Eine Anfängerfrage, habe aber nix hier dazu gefunden:

ich habe Form1,Form2, Form3

Form3 wird von Form1 oder Form2 aufgerufen.

Nun soll ein Parameter (Kunde) von Form1 oder Form2 an form3 übergeben werden.

Allerdings möchte ich Kunde nicht unbedingt global über das ganze Projekt deklarieren.

Wie kann man das machen?
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 27.06.05 11:09 
Entweder Kunde als Parameter der Funktion zum Umschalten der Forms übergeben

ODER

Kunde über die Formulare per USES selbstständig im Zielform lesen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Josef-B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 293

2003 Server, Win7, Win8
Delphi 2010 Pro, Firebird 2.5
BeitragVerfasst: Mo 27.06.05 11:11 
per uses ist klar,

kannst Du das mit den Parametern noch genauer erklären?

Danke
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 27.06.05 11:46 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm3.SelectAndShowCustomer(ACustomer: String);
begin
    CustomerName.Text := ACustomer;
    //Weitere Befehle um die Kundendaten auf's Form zu bringen ...
    Self.Show;
end;


Parameterliste um Aufrufer (ACaller:TForm) noch erweiterbar ...

Auf Form1 oder Form2 rufst Du Form3 dann so auf:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
Uses UnitWithForm3;

Procedure TForm1.ShowUserButtonClick(Sender: TObject);
Begin
    Form3.SelectAndShowUser(Kunde.Text);
end;

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.