Autor Beitrag
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Di 14.01.03 19:59 
Hi,
ich möchte machen, dass wenn ein bestimmtes Wort in einen Editfeld eingegeben wird und mann auf einen Button drückt das dann ein Fenster (z.B. form2) geöffnet wird. Kann auch mit druck auf ENTER geöffnet werden.
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Di 14.01.03 20:06 
Hi,

Du könntest Den entsprechenden Button (der der dafür sorgt das das zweite Fenster angezeigt wird) als Default einstellen. Einfach im Objektinspektor die Eigenschaft Default auf True setzen. Wenn der User dann Enter drückt wird der Button automatisch "gedrückt".

Oder Du regierst im OnKeyPress-Event des Editfeld auf die Tastaturklicks.

Gruß
TINO
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Di 14.01.03 20:27 
Schon gut, aber es darf ja nur bei einen bestimmten Wort funktionieren. Ähnlich wie in der MS-DOS-Eingabeaufforderung. Ist bestimmt ein wenig schwer, oder?!
snoisia
Hält's aus hier
Beiträge: 2



BeitragVerfasst: Di 14.01.03 20:48 
mach bei der procedur onChange von dem editfeld ne abfrage die jedesma checkt ob das wort eingegeben wurde.
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 15.01.03 14:56 
Kann mir jemand die procedure für die Abfrage posten.
Raphael O.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1596


VS 2013
BeitragVerfasst: Mi 15.01.03 15:01 
ausblenden Quelltext
1:
2:
3:
4:
procedure button1click(sender:Tobject);
begin
if editfel.text="123" then form2.show;
end;


meintest du so??
wenn man auf den Button klickt wird nur ein neues Fenster geöffnet, wenn das richtige im editfeld steht...

Fiji-Fighter

Moderiert von user profile iconMarc: Code-Tag berichtigt.
Luncustaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Mi 15.01.03 15:01 
ausblenden Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Edit1OnChange (Sender : TObjekt)
begin
  if Edit1.Text = 'dein wort' then
     Form2.ShowModal;
end;


so sollte es eigentlich funktionieren.

gr€€tz
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 15.01.03 15:32 
DANKE, melde mich wieder ob`s funktioniert hat!
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 15.01.03 15:38 
Das funktioniert! Und wie kann ich jetzt mehrere Wörter machen, die jeweils ein anderes Fenster öffnen.
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Mi 15.01.03 16:02 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
if edit1.text = '123' then
begin
form2.show;
end
else if edit1.text = '456' then
begin
form3.show;
end
else if edit1.text = '789' then
begin
form4.show;
end;


Moderiert von user profile iconMarc: Code-Tag hinzugefügt.
Andreas L. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Mi 15.01.03 20:20 
DANKE an alle. Jetzt funktioniert alles.
torstenheinze
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 461



BeitragVerfasst: Mi 15.01.03 20:21 
gern geschehen