# Adding Mask

## Content

You can easily add a mask for currency values using the [Mask](/componentone/api/wpf/online-basiclibrary/dotnet-framework-api/C1.WPF.4.6.2/C1.WPF.C1MaskedTextBox.Mask.html) property. By default the [C1MaskedTextBox](/componentone/api/wpf/online-basiclibrary/dotnet-framework-api/C1.WPF.4.6.2/C1.WPF.C1MaskedTextBox.html) control starts with its **Mask** not set but you can customize this at design time, in XAML, and in code. For more details about mask characters, see [Mask Elements](/componentone/docs/wpf/online-basiclibrary/overview/MaskedTextBox/MaskElements).

### In XAML

For example, to set the **Mask** property add **Mask="$999,999.00"** to the **\<c1:C1MaskedTextBox>** tag so that it appears similar to the following:

```xml
<c1:C1MaskedTextBox Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="C1MaskedTextBox1" VerticalAlignment="Top" Width="120" Mask="$999,999.00"></c1:C1MaskedTextBox>
```

### In Code

For example, to set the **Mask** property add the following code to your project:

```vbnet
C1MaskedTextBox1.Mask = "$999,999.00"
```

```csharp
c1MaskedTextBox1.Mask = "$999,999.00";
```

### At Design Time

To set the **Mask** property at run time, complete the following steps:

1. Click the **C1MaskedTextBox** control once to select it.
2. Navigate to the **Properties** window and enter "$999,999.00" in the text box next to the **Mask** property.

This will have set the **Mask** property to the number you chose.

**Run your project and observe**:

The mask will appear in the control:

![](https://cdn.mescius.io/document-site-files/images/7e9deccd-1f1c-4ec7-af90-b4332b45dead/images/maskedtextbox/mask1.png)

Enter a number; notice that the mask is filled:

![](https://cdn.mescius.io/document-site-files/images/7e9deccd-1f1c-4ec7-af90-b4332b45dead/images/maskedtextbox/mask2.png)