private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { TextBox txt = e.Control as TextBox; txt.PreviewKeyDown+=new PreviewKeyDownEventHandler(txt_PreviewKeyDown); } void txt_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyValue == 13) { MessageBox.Show("Press Enter"); } }
public partial class Form2 : Form { public Form2() { InitializeComponent(); this.dataGridView1.EditingControlShowing += new System.Windows.Forms.DataGridViewEditingControlShowingEventHandler(this.dataGridView1_EditingControlShowing); this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown); this.dataGridView1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.dataGridView1_KeyPress); this.dataGridView1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyUp); } private void dataGridView1_KeyDown(object sender, KeyEventArgs e) { richTextBox1.Text += "\n dataGridView1_KeyDown " + e.KeyCode; } private void dataGridView1_KeyPress(object sender, KeyPressEventArgs e) { richTextBox1.Text += "\n dataGridView1_KeyPress " + e.KeyChar; } private void dataGridView1_KeyUp(object sender, KeyEventArgs e) { richTextBox1.Text += "\n dataGridView1_KeyUp " + e.KeyCode; } private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { TextBox txt = e.Control as TextBox; txt.PreviewKeyDown += new PreviewKeyDownEventHandler(txt_PreviewKeyDown); } void txt_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { richTextBox1.Text += "\n txt_PreviewKeyDown " + e.KeyCode; } }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง