不多说了,直接插代码:) 不用Api
public Form1()
{
  InitializeComponent();

  Application.Idle 
+= new EventHandler(Application_Idle);
}
private void Application_Idle(object sender, EventArgs e)
{
  
if (Control.IsKeyLocked(Keys.NumLock))
    labelNumLock.Text 
= "ON";
  
else
    labelNumLock.Text 
= "OFF";

  
if (Control.IsKeyLocked(Keys.CapsLock))
    labelCapsLock.Text 
= "ON";
  
else
    labelCapsLock.Text 
= "OFF";

  
if (Control.IsKeyLocked(Keys.Scroll))
    labelScrollLock.Text 
= "ON";
  
else
    labelScrollLock.Text 
= "OFF";


  
if (Control.IsKeyLocked(Keys.Insert))
    labelInsert.Text 
= "ON";
  
else
    labelInsert.Text 
= "OFF";
郁闷,我的博客出了BUG。

相关文章:

  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2021-05-26
  • 2021-08-10
  • 2022-12-23
  • 2021-10-04
  • 2021-06-23
猜你喜欢
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-20
  • 2022-12-23
相关资源
相似解决方案