Stop Delete key from firing


Author
Message
Craig Browder
Craig Browder
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
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;
}
}
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search