Autor Beitrag
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 12.10.04 17:14 
Hi,

ich muß im OnChange eines Edit-Feldes eine bestimmte Taste abfangen. Wie soll ich das machen ? :shock: Habe ja keinen direkten Key. Wenn ich also eine 8 in eine 9 umwandle, wie würde das gehen ?

_________________
Gruß
Hansa
.Chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1112



BeitragVerfasst: Di 12.10.04 17:17 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
  s : string;
begin
  s:=Edit1.Text;
  if s[Edit1.SelStart-1] = '8' then s[Edit1.SelStart-1]:='9';
  Edit1.Text:=s;

So? (Fehlerabragen nicht vergessen)

Gruß,
Jörg

_________________
Die Antworten auf die 5 häufigsten Fragen:
1. Copy(), Pos(), Length() --- 2. DoubleBuffered:=True; --- 3. Application.ProcessMessages bzw. TThread --- 4. ShellExecute() --- 5. Keine Vergleiche von Real-Typen mit "="!
hansa Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Di 12.10.04 18:44 
Ne, da wäre ich womöglich noch selbst drauf gekommen. Es geht ausgerechnet noch um Funktionstasten. :evil:

_________________
Gruß
Hansa
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 12.10.04 19:05 
Warum geht denn das KeyDown-Ereignis des Edit-Feldes nicht???