var KeyState: TKeyboardState; begin GetKeyboardState(KeyState); if (KeyState[vk_capital] = 0) then Label1.caption := 'CAPS LOCK'; else Label1.caption := ''; end;
var KeyState: TKeyboardState; begin GetKeyboardState(KeyState); if (KeyState[vk_capital] = 0) then Label1.caption := ''; else Label1.caption := 'CAPS LOCK'; end;
var KeyState: TKeyboardState; begin GetKeyboardState(KeyState); if (KeyState[vk_capital] = 0) then Label2.caption := 'Overskriv'; else Label2.caption := 'Indsæt'; end;
Og det var vist omvendt.. at efter else skulle der stå 'CAPS LOCK' og før else skulle der stå '' ;)
var KeyState: TKeyboardState; begin GetKeyboardState(KeyState); if (KeyState[vk_insert] = 0) then Label2.caption := 'Overskriv'; else Label2.caption := 'Indsæt'; end;
du kan godt nøjes med at kalde GetKeyboardState en gang
var KeyState: TKeyboardState; begin GetKeyboardState(KeyState); if (KeyState[vk_capital] = 0) then Label1.caption := '' else Label1.caption := 'CAPS LOCK';
if (KeyState[vk_insert] = 0) then Label2.caption := 'Overskriv' else Label2.caption := 'Indsæt'; end;
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.