# Connecting a C1RichTextBoxToolbar to a C1RichTextBox

## Content



To connect a [C1RichTextBoxToolbar](/componentone/api/wpf/online-richtextbox/dotnet-framework-api/C1.WPF.RichTextBox.Toolbar.4.6.2/C1.WPF.RichTextBox.C1RichTextBoxToolbar.html) control to a [C1RichTextBox](/componentone/api/wpf/online-richtextbox/dotnet-api/C1.WPF.RichTextBox/C1.WPF.RichTextBox.C1RichTextBox.html) control you would need to set the [C1RichTextBoxToolbar.RichTextBox](/componentone/api/wpf/online-richtextbox/dotnet-framework-api/C1.WPF.RichTextBox.Toolbar.4.6.2/C1.WPF.RichTextBox.C1RichTextBoxToolbar.RichTextBox.html) property to the name of the control you want to link with the toolbar. You can connect a **C1RichTextBoxToolbar** control to a **C1RichTextBox** control at design time, in XAML, and in code.

**At Design Time**

To set the **C1RichTextBoxToolbar.RichTextBox** property in Microsoft Expression Blend, complete the following steps:

1.  Click the **C1RichTextBox** control once to select it.
2.  Navigate to the Properties window, and click the **Advanced Options** button next to the **C1RichTextBoxToolbar.RichTextBox** property.
3.  In the **Create Data Binding** dialog box, click the **Element Property** tab.
4.  In the **Element Property** tab, select the **C1RichTextBox1** item and click **OK**.

This will set the **C1RichTextBoxToolbar.RichTextBox** property to **C1RichTextBox1**.

**In XAML**

For example, to set the **C1RichTextBoxToolbar.RichTextBox** property addRichTextBox="{Binding ElementName=C1RichTextBox1}" to the <c1rtb:C1RichTextBox> tag so that it appears similar to the following:

<c1rtb:C1RichTextBox HorizontalAlignment="Left" Margin="10,10,0,0" Name="C1RichTextBox1" VerticalAlignment="Top" c1:C1NagScreen.Nag="True" Height="83" Width="208" RichTextBox="{Binding ElementName=C1RichTextBox1}" />

**In Code**

For example, to set the **C1RichTextBoxToolbar.RichTextBox** property add the following code to your project:

```vbnet
Me.C1RichTextBoxToolbar1.RichTextBox = C1RichTextBox1
```

```csharp
this.c1RichTextBoxToolbar1.RichTextBox = c1RichTextBox1;
```

**What You've Accomplished**

You've linked a **C1RichTextBoxToolbar** to a **C1RichTextBox** control. Now when you type text in the **C1RichTextBox**, for example, change the content appearance, for example, the font. For more information about the **C1RichTextBox** control, see the [Working with C1RichTextBoxToolbar](/componentone/docs/wpf/online-richtextbox/working_richtextboxtoolbar) topics.