Sorry I forgot...I am using the KeyDown event i.e.
private void treeView1_KeyDown(object sender,
System.Windows.Forms.KeyEventArgs e)
{
if (e.KeyCode == Keys.Insert)
{
MessageBox.Show("Pressed " + e.KeyCode);
if (e.Control)
{
MessageBox.Show("Pressed " + e.KeyCode);
}
else if (e.Shift)
{
MessageBox.Show("Pressed " + e.KeyCode);
}
else
{
MessageBox.Show("Pressed " + e.KeyCode);
}
}
"Stoitcho Goutsev (100) [C# MVP]" <10*@100.com> wrote in message
news:eh**************@TK2MSFTNGP09.phx.gbl...
Hi meh,
If you read carefully in MSDN there is written
MSDN:
"The KeyPress event is not raised by noncharacter keys; however, the
noncharacter keys do raise the KeyDown and KeyUp events."
Delete and Insert keys are non-character keys.
--
HTH
Stoitcho Goutsev (100) [C# MVP]
"meh" <no*************@cox.net> wrote in message
news:eg**************@TK2MSFTNGP10.phx.gbl... This should wotk I think but its not trapping the Insert or Delete key???
Do I not have this written correctly?
if (e.KeyCode == Keys.Insert)
{
MessageBox.Show("Pressed " + e.KeyCode);
if (e.Control)
{
MessageBox.Show("Pressed " + e.KeyCode);
}
else if (e.Shift)
{
MessageBox.Show("Pressed " + e.KeyCode);
}
else
{
MessageBox.Show("Pressed " + e.KeyCode);
}
}