Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
# How-to-modify-or-disable-shortcuts-of-EditControl
This repository contains the sample that how to modify or disable shortcuts of EditControl.
# How to Modify or Disable Shortcuts of EditControl
This repository provides a detailed example of how to modify or disable keyboard shortcuts in the Syncfusion EditControl for WPF applications. The EditControl is a versatile text editor component that supports syntax highlighting, code editing, and customizable features. In certain scenarios, developers may want to override or disable default shortcuts such as Undo (Ctrl+Z) and Redo (Ctrl+Y) to implement custom logic or restrict user actions.

The EditControl Undo and Redo functionality can be modify or disable by using the IsUndoEnabled and IsRedoEnabled property of Editcontrol.
## Key Features Demonstrated in This Sample

- Disable Undo and Redo functionality using the built-in properties IsUndoEnabled and IsRedoEnabled.
- Intercept keyboard shortcuts using the PreviewKeyDown event.
- Apply conditional logic to enable or disable specific shortcuts dynamically.

## Disable Undo and Redo Using Properties
The simplest way to disable these features is by setting the properties:

```C#
public Window1()
Expand All @@ -10,7 +17,8 @@ Edit1.PreviewKeyDown += Edit1_PreviewKeyDown;
}
```

You can also use our PreviewKeyDown event to modify this Undo and Redo features using the following code:
## Modify Shortcuts Using PreviewKeyDown Event
You can also customize shortcut behavior by handling the PreviewKeyDown event:

```C#
private void Edit1_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
Expand All @@ -23,3 +31,4 @@ Edit1.IsUndoEnabled = true;
}
```

This approach gives you full control over how shortcuts behave, allowing you to implement advanced scenarios such as enabling Undo only for certain operations or disabling it entirely in read-only modes.