# Using a Custom Dialog Box

C1Editor control allows to create your own customized version of any built-in C1Editor dialog box. Learn more about Custom dialog box in C1Editor for WinForms documentation.

## Content



There may be instances where you want to use your own custom version of the built-in [C1Editor](/componentone/api/win/online-richtexteditor/dotnet-framework-api/C1.Win.C1Editor.4.8/C1.Win.C1Editor.C1Editor.html) dialog boxes. This can easily be done with the [CustomDialogs](/componentone/api/win/online-richtexteditor/dotnet-framework-api/C1.Win.C1Editor.4.8/C1.Win.C1Editor.C1Editor.CustomDialogs.html) property.

First implement the custom dialog box and make sure it supports the appropriate interface, **IFindReplaceDialog** for a custom **Find and Replace** dialog box, for example.

In this example, we'll assume you have created three custom dialog boxes: **BookmarkDialog**, **FindReplaceDialog**, and **FormattingDialog**.

Add the following code to your project to set the CustomDialogs property.

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
private void InitCustomDialogs()
        {
            editor.CustomDialogs.BookmarkDialog = new BookmarkEditorForm();
            editor.CustomDialogs.FindReplaceDialog = new FindReplaceForm();
            editor.CustomDialogs.FormattingDialog = new FormattingForm();
        }
```

DOC-DETAILS-TAG-CLOSE

Then you can use the [ShowDialog](/componentone/api/win/online-richtexteditor/dotnet-framework-api/C1.Win.C1Editor.4.8/C1.Win.C1Editor.C1Editor.ShowDialog.html) method to open each new dialog box. In this example, we have a toolStrip with three buttons that, when clicked, open the custom dialog boxes.

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {
            // opens the Bookmark dialog box
            if (e.ClickedItem == buttonBookmark)
               editor.ShowDialog(C1.Win.Editor.DialogType.Bookmark);
            // opens the Find dialog box
            else if (e.ClickedItem == buttonFind)
               editor.ShowDialog(C1.Win.Editor.DialogType.Find);
            // opens the Formatting dialog box
            else if (e.ClickedItem == buttonFormatting)
               editor.ShowDialog(C1.Win.Editor.DialogType.Format);
        }
```

DOC-DETAILS-TAG-CLOSE

For a detailed example on creating and using custom dialog boxes, see the **Custom** **Dialogs** sample installed with the product.