Autor Beitrag
LastRide
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Sa 19.04.08 14:54 
Also ich habe meinen Taschenrechner jetzt soweit das er auf Button Klick Form2 öffnet (ist ja auch nicht schwer). Nun aber zu meinem eigentlichen Problem und zwar soll in Form2 nun eine Eingabe aus einem Editfeld in Form1 übernommen werden. Und da komme ich nicht weiter und hoffe das ihr mir helfen könnt.

Wie bringe ich also mein Programm dazu eine Eingabe aus einem Editfeld in Form1 in einem Label auf Form2 darzustellen?

Ich hoffe ihr könnt mir bei diesem Problem weiterhelfen.

MfG LastRide
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 19.04.08 15:00 
ausblenden Delphi-Quelltext
1:
Form2.Label.Caption:=Edit.Text;					

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Sa 19.04.08 15:03 
Okay das war natürlich einfach xD danke dir Trotzdem. jetzt noch kurz das muss mit zu dem Button der die Form öffnet oder ?

MfG LastRide
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Sa 19.04.08 15:22 
Hi,

Da liegst du schon ganz richtig:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.Button1Click(Sender: TObject);
var
  EinstellungenFrm: TForm2;
begin
  EinstellungenFrm := TForm2.Create(Self{Form1});
  try  //Wenn hier ein Fehler auftritt, wird trotzdem der "finally"-Block aufgerufen
    EinstellungenFrm.Label1.Caption := Edit1.Text;
    EinstellungenFrm.ShowModal;
  finally
    EinstellungenFrm.Free;
  end;
end;


Falls sie wirklich noch Form2 heißt, solltest du dir angewöhnen, deinen Komponenten(selbsterklärende) Namen zu geben, damit jeder hindurchfindet, bzw. du auch noch in drei Monaten.

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
LastRide Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47



BeitragVerfasst: Sa 19.04.08 15:29 
Nein sie heißt nicht mehr Form2 ;). Trotzdem danke für deine Ausführliche Antwort.

MfG LastRide