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