Autor Beitrag
hassedelphi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 101

WIN XP
D7 Enterprise
BeitragVerfasst: Mo 22.12.03 12:04 
hi

ich möchte, dass der nutzer in einer combobox eine taste auswählen kann.
wenn er nun die taste drückt, soll z.b. showmessage('ja') ausgegeben werden. ich hab ver sucht das so zu machen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
...
var: Taste:string;
begin
 Taste:=combobox1.text  //in der combo stehen die konstanten:
                                       //(VK_0; VK_1; VK_2; VK_NUMPAD9; ...)
end;

procedure TForm4.FormKeyPress(Sender: TObject; var Key: Char);
begin
 if key = Taste then showmessage('ja');
end;


das funzt aber leider nicht.
kann jmd. helfen?

_________________
you're not be able to help, that you're an human
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Mo 22.12.03 12:35 
Die Tastencodes VK_xxx sind Typen, keine Strings.
Du musst die Umwandung selbst vornehmen.

z.b. if taste='VK_RETURN' then KeyCode:= VK_RETURN

grez
msch

_________________
ist das politisch, wenn ich linksdrehenden Joghurt haben möchte?
hassedelphi Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 101

WIN XP
D7 Enterprise
BeitragVerfasst: Mo 22.12.03 13:02 
danke :D

_________________
you're not be able to help, that you're an human