---
title: " 检测大写字母锁定键的状态"
author: "tianshui0"
date: "2008-11-25T15:37:55Z"
tags: []
slug: "untitled"
draft: false
lastmod: "2008-11-25T15:38:29Z"
id: 277883
url: "https://zohan.iteye.com/blog/277883"
---

```
var
 state:short ;
begin
    state:=GetKeyState(VK_CAPITAL);
    if(state=1) then
    self.Edit1.ShowHint:=true;
    then ShowMessage('Capslock on')
    else ShowMessage('Capslock off');
end;
```