System.Windows.Forms.SendKeys.Send("{CAPSLOCK}"); ? System.Windows.Forms.SendKeys.Send("{CAPSLOCK}"); 在VS2008中,这句代码为什么不起作用呢?其指示灯就是不亮 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 使用下面的吧[DllImport("user32.dll")]static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,UIntPtr dwExtraInfo); private void button1_Click(object sender, EventArgs e){ this.textBox1.Focus(); const int KEYEVENTF_EXTENDEDKEY = 0x1; const int KEYEVENTF_KEYUP = 0x2; keybd_event(0x14, 0x45, KEYEVENTF_EXTENDEDKEY, (UIntPtr)0); keybd_event(0x14, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,(UIntPtr)0);} 代码是没错,可为什么CAPSLOCK指示灯就是不亮(或变暗)呢?尽管下面的代码达到了效果: this.textBox1.Focus(); System.Windows.Forms.SendKeys.Send("abc"); //Output:abc System.Windows.Forms.SendKeys.Send("{CAPSLOCK}"); System.Windows.Forms.SendKeys.Send("abc"); //Output:ABC 获取对象,再模拟键盘按键 this.textBox1.Focus(); System.Windows.Forms.SendKeys.Send("{CAPSLOCK}"); this.textBox1.Focus(); System.Windows.Forms.SendKeys.Send("{CAPSLOCK}"); 代码没错 ;可是指示灯就是不变亮或暗,诸位能帮我看 下你们那也是同样的么? 如何使用 WebClient 登录一个页面? 能否定义一个多个类共用的哈希表 按钮事件是谁来触发的? winform 中如何实现视频播放功能 帮忙忙啦,如何判断一个路径下存在几个文件 关于程序员的问题 string输出后这样的字符“↑┓”是何编码? 用c#可以开发硬件驱动程序吗? xml资料的处理???? 简单的问题:在C#里 MessgeBox("TEST","C#",MB_OK);该怎么写? C#中XmlReader的ReadContentAsDateTime()函数要求什么样的数据类型啊! 有谁发个VS2005控件对应的效果啊
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,UIntPtr dwExtraInfo); private void button1_Click(object sender, EventArgs e)
{
this.textBox1.Focus(); const int KEYEVENTF_EXTENDEDKEY = 0x1;
const int KEYEVENTF_KEYUP = 0x2;
keybd_event(0x14, 0x45, KEYEVENTF_EXTENDEDKEY, (UIntPtr)0);
keybd_event(0x14, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,(UIntPtr)0);}
代码是没错,可为什么CAPSLOCK指示灯就是不亮(或变暗)呢?
尽管下面的代码达到了效果:
this.textBox1.Focus();
System.Windows.Forms.SendKeys.Send("abc"); //Output:abc
System.Windows.Forms.SendKeys.Send("{CAPSLOCK}");
System.Windows.Forms.SendKeys.Send("abc"); //Output:ABC
this.textBox1.Focus();
System.Windows.Forms.SendKeys.Send("{CAPSLOCK}");
System.Windows.Forms.SendKeys.Send("{CAPSLOCK}"); 代码没错 ;
可是指示灯就是不变亮或暗,诸位能帮我看 下你们那也是同样的么?