在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
System.Windows.Forms.SendKeys 以下是 SendKeys 的一些特殊键 {//英文输入
this.richTextBox1.Focus();
for(int i=65;i<91;i++) { char Letter=(char)i; SendKeys.Send(Letter.ToString()); System.Threading.Thread.Sleep(100); SendKeys.Flush(); } for(int i=97;i<123;i++) { char Letter=(char)i; SendKeys.Send(Letter.ToString()); System.Threading.Thread.Sleep(100); SendKeys.Flush(); } } private void button3_Click(object sender, System.EventArgs e) {//数字输入
this.richTextBox1.Focus();
for(int i=0;i<10;i++) { SendKeys.Send(i.ToString()); System.Threading.Thread.Sleep(100); SendKeys.Flush(); } } private void button4_Click(object sender, System.EventArgs e) {//Backspace
this.richTextBox1.Focus();
SendKeys.Send("{Backspace}");
} private void button5_Click(object sender, System.EventArgs e) {//Home
this.richTextBox1.Focus();
SendKeys.Send("{Home}");
} private void button6_Click(object sender, System.EventArgs e) {//End
this.richTextBox1.Focus();
SendKeys.Send("{End}");
} private void button7_Click(object sender, System.EventArgs e) {//Enter
this.richTextBox1.Focus();
SendKeys.Send("{Enter}");
} private void button8_Click(object sender, System.EventArgs e) {//Delete
this.richTextBox1.Focus();
SendKeys.Send("{Delete}");
} private void button2_Click(object sender, System.EventArgs e) {//Shift+Home
this.richTextBox1.Focus();
SendKeys.Send("+{Home}");
} private void button9_Click(object sender, System.EventArgs e) {//Shift+End
this.richTextBox1.Focus();
SendKeys.Send("+{End}");
public class SendKeys : System.Object System.Windows.Forms 的成员 摘要: 提供将键击发送到应用程序的方法。
public static void Send ( System.String keys ) System.Windows.Forms.SendKeys 的成员 摘要: 向活动应用程序发送击键。
public static void Sleep ( System.TimeSpan timeout ) System.Threading.Thread 的成员 摘要:
public static void Flush ( ) System.Windows.Forms.SendKeys 的成员 2.模拟鼠标
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论