# Adding an Overlay Image to the Taskbar Button

## Content



The overlay image is used to communicate information with a user about the state of an application. The [C1TaskbarButton](/componentone/api/win/online-winpack/dotnet-framework-api/C1.Win.C1Win7Pack.4.8/C1.Win.C1Win7Pack.C1TaskbarButton.html)s overly icon can be set at design time in the **Properties** window or can be set via code for run time interaction. It is more common to see this property set when a specific event occurs at run time, but this topic will explain how to do it both ways.


> type=note
> **Note**: The icon overlay should always be 16 pixels by 16 pixels.

### In the Designer

In the Properties window, click the ellipses button next to the [OverlayIcon](/componentone/api/win/online-winpack/dotnet-framework-api/C1.Win.C1Win7Pack.4.8/C1.Win.C1Win7Pack.C1TaskbarButton.OverlayIcon.html) and select your image from the **Image** dialog box.

### In Code

Usually, you'll want to use an overlay icon in response to an application state, response, or event. The easiest thing to do is to add your preferred .ico file to the project as a resource or to use the existing system icons.

This example illustrates how to add an overlay icon to a simple **Button\_Click** event using system icons.

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
taskbarButton.OverlayIcon = New Icon(SystemIcons.[Error], 16, 16)
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
taskbarButton.OverlayIcon = new Icon(SystemIcons.Error, 16, 16);
```

DOC-DETAILS-TAG-CLOSE

This example illustrates how to add an overlay icon to a simple **Button\_Click** event using an embedded .ico resource named "Error".

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in Visual Basic

DOC-SUMMARY-TAG-CLOSE

```vbnet
taskbarButton.OverlayIcon = Properties.Resources.[Error]
```

DOC-DETAILS-TAG-CLOSE

DOC-DETAILS-TAG-OPEN

DOC-SUMMARY-TAG-OPEN

To write code in C#

DOC-SUMMARY-TAG-CLOSE

```csharp
taskbarButton.OverlayIcon = Properties.Resources.Error;
```

DOC-DETAILS-TAG-CLOSE