Autor Beitrag
Tabakbrummel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 124

win 7
Turbo Delphi, VS 20010 Express
BeitragVerfasst: Do 23.03.06 14:41 
Hallo

Ich möchte das wenn die MumLocktaste aktiviert ist im Statusbar anzeigt und wenn die MumLocktaste deaktiviert wierder ausblendet. Wie mache ich es am besten?

MfG
Tabakbrummel
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 23.03.06 19:41 
Hallo,

damit kannst Du den Status der Taste abfragen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
if GetAsyncKeyState(vk_NumLock)= 0 then
  Caption := 'NumLock ist an'
  else
    Caption := 'NumLock ist aus';

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Tabakbrummel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 124

win 7
Turbo Delphi, VS 20010 Express
BeitragVerfasst: Do 23.03.06 20:12 
Hallo

Funktioniert nicht.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.FormShow(Sender: TObject);
begin
if GetAsyncKeyState(vk_NumLock)= 0 then
  StatusBar1.Panels.Items[4].Text := 'NumLock ist an'
  else
  StatusBar1.Panels.Items[4].Text := 'NumLock ist aus';
end;


MfG
Tabakbrummel
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 23.03.06 22:29 
Hallo,

:gruebel: teste mal das:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.FormShow(Sender: TObject);
var
KeyState: TKeyboardState;
begin
GetKeyboardState(KeyState);
if (KeyState[VK_NUMLOCK] and $01) <> 0 then
  StatusBar1.Panels.Items[4].Text := 'NumLock ist an'
  else
    StatusBar1.Panels.Items[4].Text := 'NumLock ist aus';
end;

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Tabakbrummel Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 124

win 7
Turbo Delphi, VS 20010 Express
BeitragVerfasst: Fr 24.03.06 11:15 
Hallo

Es funktioniert aber nur wenn ich es unter
ausblenden Delphi-Quelltext
1:
procedure TForm1.Timer1Timer(Sender: TObject);					

einfüge. Aber besten Dank für die Antworten.