Profile Picture

Stop Delete key from firing

Posted By Craig Browder 10 Years Ago
Author
Message
Craig Browder
Posted 10 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: Forum Members
Last Active: 10 Years Ago
Posts: 9, Visits: 17
I cannot stop the delete key from firing. can you please take a look at the code below and let me know what I am doing incorrectly?
I over-rode the ProcessCmdKey method because NodeKeyPress didn't detect the delete key being pressed.


protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.Delete)
{
EventSinkService_NodeKeyPress(new NKeyPressEventArgs(this.nDrawingView1, (char)keyData));

keyData = Keys.Space;
}

return base.ProcessCmdKey(ref msg, keyData);
}

void EventSinkService_NodeKeyPress(NKeyPressEventArgs args)
{
if (this.ReadOnly == true)
{
if (args.KeyChar == (Char)Keys.Delete)
args.Handled = true;
}
}




Similar Topics


Reading This Topic