Keyboard key location Daquan:
System. Windows. Forms. sendkeys
Key code
Backspace {backspace}, {BS}, or {bksp}
Break {break}
Caps Lock {capslock}
Del or delete {Delete} or {del}
Down Arrow (down arrow) {down}
End {end}
Enter {enter} Or ~
ESC {ESC}
Help {help}
Home {home}
INS, insert {insert}, or {ins}
Left arrow (left arrow) {left}
Num Lock {numlock}
Page down {pgdn}
Page up {pgup}
Print Screen {prtsc} (reserved for future use)
Right arrow (right arrow) {right}
Scroll lock {scrolllock}
Tab {tab}
Up Arrow (up arrow) {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}
Numeric keypad plus sign {Add}
Keyboard minus {subtract}
Numeric keypad multiplication number {multiply}
Keypad division {divide}
To specify keys that can be used with any combination of shift, Ctrl, and ALT keys, add one or more codes before these key codes:
Key code
Shift + (shift = "+ ")
CTRL ^ (CTRL = "^") if you enter
Alt %
When using these keys, you still need sendkeys. sendwait ("operator ");
In this case, if you want to move a form other than a program, you also need to add a Windows API
// The hwnd to move the form is the handle value of the window, X, Y coordinate, nwidth, and nheight window size.
[Dllimport ("user32.dll", entrypoint = "movewindow")]
Public static extern int movewindow (INT hwnd, int X, int y, int nwidth, int nheight, int brepaint );
// Obtain the handle
[Dllimport ("user32.dll")]
Public static extern intptr findwindow (string lpclassname, string lpwindowname );
// Obtain the handle
Intptr hwnd = findwindow (null, "Name of the window to be called ");
// Move the form
Movewindow (hwnd. toint32 (), 0, 0,650,500, 0 );
Simulated operation (keyboard and mouse) 2