private void btnPress_Click(object sender, EventArgs e)
{
String key = ((Button)sender).Text;
InputSimulator.SimulateTextEntry(key);
SendKeys.SendWait(VirtualKeyCode.NUMPAD4.ToString());
}
[DllImport("user32.dll")]
public static extern int SetForegroundWindow(IntPtr hWnd);
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new KeyPress());
}
这件事没有任何帮助。当我单击我的文本框并单击 ont button1 时,此处不会出现 1.. 并且文本框焦点也丢失了..