Modify or disable shortcuts of EditControl

Hi,

I am using EditControl for WPF in my project. I want to control the undo and redo command of the text by myself. How is it possible disable and modify the shortcuts, for exemple Crtl+Z and Crtl+Y, on EditControl?

Best regards
Guilherme



5 Replies 1 reply marked as answer

VR Vijayalakshmi Roopkumar Syncfusion Team January 4, 2021 12:26 PM UTC

Hi Guilherme,                                                                                                                  
 
Thank you for using our Syncfusion Products. 
 
Query :   am using EditControl for WPF in my project. I want to control the undo and redo command of the text by myself. How is it possible disable and modify the shortcuts, for exemple Crtl+Z and Crtl+Y, on EditControl? 
 
We have checked the reported requirement that you want to control redo and undo functionality for the editcontrol by yourself. For this you can use the following property IsUndoEnabled and IsRedoEnabled property of Editcontrol, which enables and disables this functionality at your end.  
 
Code: 
 
 
public Window1() 
        { 
            InitializeComponent(); 
            Edit1.IsUndoEnabled = false; 
            Edit1.IsRedoEnabled = false; 
        } 
 
 
 
You can also use our PreviewKeyDown events to modify this Undo and Redo features using the following code: 
 
 
 
private void Edit1_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) 
{ 
if(e.Key == Key.Z && (e.KeyboardDevice.Modifiers & ModifierKeys.Control) != 0) 
{ 
//Undo feature enable by checking the keys. 
Edit1.IsUndoEnabled = true; 
} 
} 
 
 
 
Please try this suggestion and let us know if it is helpful. 
 
Regards, 
Vijayalakshmi VR 



GU Guilherme January 4, 2021 05:30 PM UTC

Hi Vijayalakshmi,

thanks for your answer, i tried your suggestions and worked fine. Althouth I can't access the sample link, I received an error message "Access Denied":



VR Vijayalakshmi Roopkumar Syncfusion Team January 5, 2021 05:09 AM UTC

Hi Guilherme 
 
Thank you for your update and sorry for an inconvenience caused. 
 
Please find the correct link for the sample with Editcontrol in the following link: 
 
 
Please let us know if you have any other concerns. 
 
Regards, 
Vijayalakshmi VR 


Marked as answer

GU Guilherme February 5, 2021 02:17 PM UTC

Thank you, the shortcuts are work very well


EM Elakkiya Muthukumarasamy Syncfusion Team February 8, 2021 05:29 AM UTC

Hi Guilherme, 

Thanks for the update. We are glad to know that the issue is resolved at your end. Also, please let us know if you require any further assistance on this. As always, we will be happy to assist you. 

Regards, 
Elakkiya 


Loader.
Up arrow icon