Please, what is wrong with this code:
InitializeComponent();
this.KeyDown += new KeyEventHandler(dgvC_KeyDown);
---
private void dgvC_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 188)
{
System.Media.SystemSounds.Beep.Play();
e.SuppressKeyPress = true;
}
if (e.KeyValue == (int)Keys.Delete)
{
MessageBox.Show("323");
}
}
MessageBox appears twice !!
I want to execute some code if comma is pressed, and anotehr code ifDelKey is pressed on a DataGridView (dgvC).
MessageBox is just for test.
Loading

Jignesh TrivediPosted Jun 4, 2012, 5:03 AM
I tried your,its work fine for me.
I have just change following line.
this.dgvc.KeyDown += new KeyEventHandler(dgvC_KeyDown);
try again and update us.
hope this will help u.
MementoPosted Jun 4, 2012, 5:26 AM
btw I'm very enthusiastic about the "BookAboutNakshatras_Prash Trivedi."
thanksAgain.