New to Telerik UI for WPF? Download free 30-day trial

Format Code Block Dialog

This dialog allows you to insert and edit code blocks in the document.

An image showing the format code block dialog of RadRichTextBox for WPF

The dialog can be opened from the Code button in the Insert tab of the RadRichTextBoxRibbonUI or via the in the same option in the right-click menu (context menu) of RadRichTextBox.

An image showing the button that opens the format code block dialog of RadRichTextBox for WPF

An image showing the context menu that opens the format code block dialog of RadRichTextBox for WPF

Showing the Dialog Manually

The dialog can be shown by executing the ShowCodeFormattingDialogCommand. See how to bind the command to an external button in the Commands article.

Executing the show dialog command

this.richTextBox.Commands.ShowCodeFormattingDialogCommand.Execute(null); 
Alternatively, call the ShowCodeFormattingDialog method of RadRichTextBox.

Using the show dialog method

this.richTextBox.ShowCodeFormattingDialog(); 
In this article