# Styling and Appearance

Learn about different styling and appearance possibilities using C1Barcode control.

## Content



BarCode provides various options to style the appearance of the control, so that you can generate Barcode as per your requirement and change the look and feel of the application you are creating.

## Set ForeGround

You can change the foreground color of the Barcode control by using the [Foreground](/componentone/api/wpf/online-barcode/dotnet-api/C1.WPF.BarCode/C1.WPF.BarCode.C1BarCode.Foreground.html) property of the <span data-popup-content="This class is available in both \u003ca href=\u0022/componentone/api/wpf/online-barcode/dotnet-api/C1.WPF.BarCode/C1.WPF.BarCode.C1BarCode.html\u0022\u003e.NET\u003c/a\u003e and .\u003ca href=\u0022/componentone/api/wpf/online-barcode/dotnet-api/C1.WPF.BarCode/C1.WPF.BarCode.C1BarCode.html\u0022\u003eNET Framework\u003c/a\u003e." data-popup-title="C1BarCode" data-popup-theme="ui-tooltip-green qtip-green">C1BarCode</span> class.

![Barcode with styling](https://cdn.mescius.io/document-site-files/images/9c23eff8-ba0d-4b5c-a723-61a3b90aaebc/images/barcode-styled.png)

In the above image, we have created a barcode with dark blue foreground and beige background colors.

You can set the Foreground of the Barcode control using the following code snippet:

**xml**

```xml
<c1:C1BarCode Name="barCode1" Text="ComponentOne@123" CodeType="Ansi39x" Foreground="DarkBlue" Background="beige" HorizontalAlignment="Left" Margin="134,217,0,0" VerticalAlignment="Top"/>
```

**csharp**

```csharp
barCode1.Foreground = new SolidColorBrush(Colors.Blue);
barCode1.Background = new SolidColorBrush(Colors.Beige);
```

## Set FontStyle

Barcode lets you customize the overall look of the text or caption, not to just increase its aesthetic value but also increases its readability. For example, you can make the caption in italics font using the **FontStyle** property. Further, you can also set the position of the caption using the [CaptionPosition](/componentone/api/wpf/online-barcode/dotnet-api/C1.WPF.BarCode/C1.WPF.BarCode.C1BarCode.CaptionPosition.html) property.

In the snapshot below, the barcode has the caption text in italics and it is positioned above the barcode.

![Font and caption in barcode snapshot](https://cdn.mescius.io/document-site-files/images/9c23eff8-ba0d-4b5c-a723-61a3b90aaebc/images/italics-font-caption-barcode.png)

You can set the fontstyle of the Barcode text and change the caption position using the following code snippet:

**xml**

```xml
<c1:C1BarCode Name="barCode1" FontStyle="Italic" Text="ComponentOne@123" CaptionPosition="Above" CodeType="Ansi39x" HorizontalAlignment="Left" Margin="134,217,0,0" VerticalAlignment="Top"/>
```

**csharp**

```csharp
barCode1.FontStyle = FontStyles.Italic;
barCode1.CaptionPosition = C1.BarCode.BarCodeCaptionPosition.Above;
```