黄聪:发送键盘指令System.Windows.Forms.SendKeys.Send

若要指定在按键(如 Enter 或 Tab)时不显示的字符,以及表示操作而不表示字符的键,请使用下表中的代码:



代码


Backspace


{BACKSPACE}、{BS} 或 {BKSP}


Break


{BREAK}


Caps Lock


{CAPSLOCK}


Del 或 Delete


{DELETE} 或 {DEL}


向下键


{DOWN}


End


{END}


Enter


{ENTER} 或 ~


Esc


{ESC}


Help


{HELP}


Home


{HOME}


Ins 或 Insert


{INSERT} 或 {INS}


向左键


{LEFT}


Num Lock


{NUMLOCK}


Page Down


{PGDN}


Page Up


{PGUP}


Print Screen


{PRTSC}(保留供将来使用)


向右键


{RIGHT}


Scroll Lock


{SCROLLLOCK}


Tab


{TAB}


向上键


{UP}


F1


{F1}


F2


{F2}


F3


{F3}


F4


{F4}


F5


{F5}


F6


{F6}


F7


{F7}


F8


{F8}


F9


{F9}


F10


{F10}


F11


{F11}


F12


{F12}


F13


{F13}


F14


{F14}


F15


{F15}


F16


{F16}


数字键盘加号


{ADD}


数字键盘减号


{SUBTRACT}


数字键盘乘号


{MULTIPLY}


数字键盘除号


{DIVIDE}

若要指定与 Shift、Ctrl 和 Alt 键的任意组合一起使用的键,请在这些键代码之前加上以下一段或多段代码。



代码


Shift


+


Ctrl


^


Alt


%

若要指定在按一些键时应同时按住 Shift、Ctrl 和 Alt 键的任意组合,请将这些键的代码放在括号内。例如,若要指定按 E 和 C 时同时按住 Shift 键,请使用“+(EC)”。若要指定按 E 时应按住 Shift,之后按 C 时不按住 Shift,请使用“+EC”。

若要指定重复键,请使用格式 {key number}。键和数字之间必须放一空格。例如,{LEFT 42} 表示按向左键 42 次;{h 10} 表示按 H 10 次。

时间: 2024-08-07 21:20:20

黄聪:发送键盘指令System.Windows.Forms.SendKeys.Send的相关文章

System.Windows.Forms.Control : Component, IOleControl, IOleObject, IOleInPlaceObject, IOleInPlaceActiveObject....

#region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 // C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll #endregion using System.Collections; using System.ComponentModel; using Syst

System.Windows.Forms.Control.Invoke与BeginInvoke

WinForm的UI对象只能在UI线程中操作,在非UI线程中操作UI对象,会引发不可预知的错误,这时就需要用到Control.Invoke或者Control.BeginInvoke. 用户线程调用Control.BeginInvoke会向UI消息队列发送一个带委托消息,Control.BeginInvoke不会阻塞用户线程,直接返回IAsyncResult对象. 用户线程调用Control.EndInvoke(IAsyncResult),Control.EndInvoke会阻塞用户线程,直到委托

System.Diagnostic.Process.Start vs System.Windows.Forms.Help.ShowHelp 打开CHM文件

CHM文件,Microsoft Compiled HTML Help,即"已编辑的帮助文件",包含一系列的HTML文件,index文件和其它的导航工具,经常作为产品的帮助文件[1]. 在.Net程序中,打开这种文件最简单的方式就是调用System.Windows.Forms.Help.ShowHelp()方法.根据MSDN,重载了四种调用方式[2].Control为父控件,string为Help文件的URL,HelpNavigator是一个枚举类型,可以采用Index或者Topic或者

System.Windows.Forms

1 File: winforms\Managed\System\WinForms\DataGridView.cs 2 Project: ndp\fx\src\System.Windows.Forms.csproj (System.Windows.Forms) 3 4 //------------------------------------------------------------------------------ 5 // <copyright file="DataGridVi

System.Windows.Forms.Timer、System.Timers.Timer、System.Threading.Timer的差别和分别什么时候用

一.System.Windows.Forms.Timer 1.基于Windows消息循环,用事件方式触发,在界面线程执行:是使用得比较多的Timer,Timer Start之后定时(按设定的Interval)调用挂接在Tick事件上的EvnetHandler.在这种Timer的EventHandler中可 以直接获取和修改UI元素而不会出现问题--因为这种Timer实际上就是在UI线程自身上进行调用的. 2.它是一个基于Form的计时器3.创建之后,你可以使用Interval设置Tick之间的跨

错误 128 无法将类型“string”隐式转换为“System.Windows.Forms.DataGridViewTextBoxColumn”

原因是DataGridView中列的Name属性值和DataPropertyName属性值一样,比如Name="CardID",DataPropertyName="CardID",这样会出现 :错误 128 无法将类型"string"隐式转换为"System.Windows.Forms.DataGridViewTextBoxColumn"

System.Windows.Forms.ListView : Control

#region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 // C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll #endregion using System.Collections; using System.ComponentModel; using Syst

WPF 添加ACTIVEX 控件 ——System.Windows.Forms.AxHost+InvalidActiveXStateException异常

---恢复内容开始--- 一.ACTIVEX及其相关概念 COM(Component Object Model,对象组件模型): DCOM(Distributed COM,分布式对象组件模型): CORBA(Common Object Request Broker Architecture,公共对象请求代理体系结构): 动态数据交换(Dynamic Data Exchange,DDE),解决了数据的更新,但数据格式仍是问题: 对象的链接与嵌入(Object Linking and Embedde

System.Windows.Forms.Timer反编译学习

1 using System; 2 using System.ComponentModel; 3 using System.Globalization; 4 using System.Runtime; 5 using System.Runtime.InteropServices; 6 using System.Threading; 7 namespace System.Windows.Forms 8 { 9 [DefaultEvent("Tick"), DefaultProperty(