# Editing Commands

The ToolStripMain class implements the Undo, Redo, Find, and Replace commands in the C1Editor control.

## Content



The **ToolStripMain** class implements the usual _Undo_, _Redo_, _Find_, and _Replace_ commands, which are also deferred to the [C1Editor](/componentone/api/win/online-richtexteditor/dotnet-framework-api/C1.Win.C1Editor.4.8/C1.Win.C1Editor.C1Editor.html) control:

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
void Undo_Click(object sender, EventArgs e)
{
    Editor.Undo();
}
void Redo_Click(object sender, EventArgs e)
{
    Editor.Redo();
}
void Find_Click(object sender, EventArgs e)
{
    Editor.ShowDialog(C1.Win.C1Editor.DialogType.Find);
}
void Replace_Click(object sender, EventArgs e)
{
    Editor.ShowDialog(C1.Win.C1Editor.DialogType.Replace);
}
```

DOC-DETAILS-TAG-CLOSE

The find and replace commands are implemented with calls to the **C1Editor**'s [ShowDialog](/componentone/api/win/online-richtexteditor/dotnet-framework-api/C1.Win.C1Editor.4.8/C1.Win.C1Editor.C1Editor.ShowDialog.html) commands, which also supports several other commands defined by the [DialogType](/componentone/api/win/online-richtexteditor/dotnet-framework-api/C1.Win.C1Editor.4.8/C1.Win.C1Editor.DialogType.html) enumeration and not used in this sample:

*   **NewTable**: Inserts a new table.
*   **Image**: Inserts or edits an image.
*   **FlashMovie**: Inserts or edits a Flash movie.
*   **Hyperlink**: Inserts or edits a hyperlink.
*   **Bookmark**: Inserts or edits a bookmark.
*   **Find**: Finds text in the document.
*   **Replace**: Finds and replaces text in the document.
*   **Format**: Applies formatting to the current selection.
*   **PageSetup**: Shows a page setup dialog.