110,534
社区成员
发帖
与我相关
我的任务
分享
public Form1()
{
InitializeComponent();
KeyPreview = true;
this.KeyDown += (s, e) => { if (e.Alt && e.KeyCode == Keys.X) MessageBox.Show("press"); };
TextBox textBox = new TextBox() { Size = new Size(100,20), Location = new Point(10,230), };
this.Controls.Add(textBox);
RichTextBox richText = new RichTextBox() { Size = new Size(200, 200), Location = new Point(10,10), };
this.Controls.Add(richText);
richText.Focus();
}