The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
In the application that I am developing, the user can select any kind of shape drawn in the diagram, and then, press the DELETE key.
I have seen when I press the DELETE key and exists a shape selected, this is deleted. But I need first to detect the code of the DELETE key BEFORE of the deletion of the shape, in another words, I need the shape don't be deleted in spite of the user presses the DELETE key (the user can decide if the shape should be deleted).
I have intended to do that by using handles for the diagram's events PreviewKeyDown,KeyUp, KeyDown and Keypress, but I can't obtained the desired operation.
ADAdministrator Syncfusion Team October 24, 2008 12:29 PM UTC
Hi RAS.
I have probed the KeyUp method, but I really need that when the user select a shape in the diagram and press the DELETE key, the shape doesn't be deleted.
Is there any form to configure the diagram for avoiding the deletion of shapes because of the press of DELETE key?
Thanks.
RARon Alan SawyerOctober 24, 2008 09:33 PM UTC
OK, I looked at this a little more closely.
On your form, set KeyPreview to true.
In your form's KeyDown event put the following code:
if (e.KeyCode == Keys.Delete) e.Handled = true; This will prevent the delete key from being passed to the diagram control and your symbol will not be deleted.
ADAdministrator Syncfusion Team October 27, 2008 01:35 PM UTC