1. //状态栏右边子面板宽度固定,左边子面板自动调整宽度:
procedure TMainFrm.StatusBar1Resize(Sender: TObject);
//使Panels[0]长度自动调整
begin
with StatusBar1 do
Panels[0].Width := Width-Panels[1].Width-Panels[2].Width-Panels[3].Width;
end;
2. //监测特殊键状态
procedure TMainFrm.Timer1Timer(Sender: TObject);
begin
if GetKeyState(VK_CAPITAL)<>0 then
StatusBar1.Panels[2].Text := 'CAPSLOCK'
else
StatusBar1.Panels[2].Text := '';
if GetKeyState(VK_NUMLOCK)<>0 then
StatusBar1.Panels[3].Text := 'NUMLOCK'
else
StatusBar1.Panels[3].Text := '';
if GetKeyState(VK_SCROLL)<>0 then
StatusBar1.Panels[4].Text := 'SCROLL'
else
StatusBar1.Panels[4].Text := '';
end;
04年掌握的一个小技巧
最新推荐文章于 2024-08-05 12:37:12 发布