Autor Beitrag
NeoXan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

WinXP Sp1 Home
D7 Prof
BeitragVerfasst: Mo 09.06.03 21:01 
Moin moin,

ich möchte, dass nach dem drücken der Enter Taste das Memo feld wieder gelöscht wird und der Cursor wieder bei Zeile 1 steht...

Bei mir steht er aber nach
ausblenden Delphi-Quelltext
1:
 Memo.Lines.Clear;					

immer bei Zeile 2 (klar nach der ENTER Taste)...

wie könnte man jetzt den Cursor wieder nach oben bekommen... vielleicht automatisch die [ARROW UP] Taste drücken...nur leider weiß ich net wie ich das anstellen könnte...

thx
NeoXan

Moderiert von user profile iconTino: Delphi-Tags hinzugefügt.
JanHH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46
Erhaltene Danke: 1



BeitragVerfasst: Di 10.06.03 04:47 
weiss auch nicht wirklich wie das geht, aber kann man nicht mit SelStart arbeiten?

Gruß
Jan
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 10.06.03 08:22 
Hallo,

wahrscheinlich prüfst Du in dem OnKeyPress- oder OnKeyDown-Event ob es sich bei der gedrückten Taste um die Entertaste handelt. Wenn ja, dann löscht du mit dem o. g. Code den Inhalt. Was Du wahrscheinlich nicht machst ist den Variable Key auf 0 zu setzen:
ausblenden Delphi-Quelltext
1:
Key := #0;					

Gruß
Tino
NeoXan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81

WinXP Sp1 Home
D7 Prof
BeitragVerfasst: Di 10.06.03 13:58 
bei #0 da motzt er rum von wegen Word und Char...

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
procedure TForm_Client_Main.memSendsKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
var
  SendData: string;
  Receivers: TStrings;
  I: Integer;
begin
  if Key = VK_Return then
  begin
   [...]

// memSend.Text := '';
    memSend.Lines.Clear;
    Key := VK_up;                  <------- hilft auch nichts :/
  end;
end;


BTW: Ich benutze übrigends TFlatMemo...
Tweafis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 647

WinXP + fbsd
Delphi 5 Prof
BeitragVerfasst: Di 10.06.03 14:16 
Und Key := 0?

Das von Tino war für die TMemo da man dort Key ein Char ist.

_________________
.: Es wird der Tag kommen, an dem wir es nicht mehr ändern können :.
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Di 10.06.03 16:21 
JanHH hat folgendes geschrieben:
weiss auch nicht wirklich wie das geht, aber kann man nicht mit SelStart arbeiten?


Jo, benutz onKeyUp und Memo1.SelStart:= 0, dann gehts

Stefan

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)