Skip to content

Commit 0e1b203

Browse files
985360: Updated ReadMe file of this repository
1 parent 7a0b139 commit 0e1b203

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
# How-to-modify-or-disable-shortcuts-of-EditControl
2-
This repository contains the sample that how to modify or disable shortcuts of EditControl.
1+
# How to Modify or Disable Shortcuts of EditControl
2+
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.
33

4-
The EditControl Undo and Redo functionality can be modify or disable by using the IsUndoEnabled and IsRedoEnabled property of Editcontrol.
4+
## Key Features Demonstrated in This Sample
5+
6+
- Disable Undo and Redo functionality using the built-in properties IsUndoEnabled and IsRedoEnabled.
7+
- Intercept keyboard shortcuts using the PreviewKeyDown event.
8+
- Apply conditional logic to enable or disable specific shortcuts dynamically.
9+
10+
## Disable Undo and Redo Using Properties
11+
The simplest way to disable these features is by setting the properties:
512

613
```C#
714
public Window1()
@@ -10,7 +17,8 @@ Edit1.PreviewKeyDown += Edit1_PreviewKeyDown;
1017
}
1118
```
1219

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

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

34+
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.

0 commit comments

Comments
 (0)