# Overlays

**RadChat** offers different overlays to present the user a selection of choices either as a pop up, or over the messages' view. The overlay is visible until the user selects a certain choice.

![WinForms RadChat winforms/chat-overview 004](https://www.telerik.com/products/winforms/documentation/assets/06b63fbd5447c8978b6251518f274bf7/chat-overview004.gif)

Depending on the information that is presented and the choice that should be made, the overlays can be one of the types listed below.

When you press the `OK` button, a new message will be automatically added with the selected option. The **SendMessage** event will be fired with the respective message as well. In the event handler you can change the message itself, e.g. modify its text.

## ChatCalendarOverlay

**ChatCalendarOverlay** offers to the user the ability to select a date from the calendar.

> caption Figure 1: ChatCalendarOverlay

![WinForms RadChat Calendar Overlay Sample](https://www.telerik.com/products/winforms/documentation/assets/2918e87e37447c07c12e5b24bd7cabb3/chat-items-overlays001.gif)

### Adding a ChatCalendarOverlay

```C#

ChatCalendarOverlay calendarOverlay = new ChatCalendarOverlay("Select a date");
bool showAsPopup = false;
Author author = new Author(Properties.Resources.andrew1, "Andrew");
ChatOverlayMessage overlayMessage = new ChatOverlayMessage(calendarOverlay, showAsPopup, author, DateTime.Now);
this.radChat1.AddMessage(overlayMessage);

```

```VB.NET
Dim calendarOverlay As ChatCalendarOverlay = New ChatCalendarOverlay("Select a date")
Dim showAsPopup As Boolean = False
Dim author As Author = New Author(My.Resources.andrew1, "Andrew")
Dim overlayMessage As ChatOverlayMessage = New ChatOverlayMessage(calendarOverlay, showAsPopup, author, DateTime.Now)
Me.radChat1.AddMessage(overlayMessage)
```

You have access to the calendar itself by the ChatCalendarOverlay.**Calendar** property.

## ChatDateTimeOverlay

**ChatDateTimeOverlay** offers to the user the ability to select date and time from the picker.

> caption Figure 2: ChatDateTimeOverlay

![WinForms RadChat DateTime Overlay Sample](https://www.telerik.com/products/winforms/documentation/assets/251100c177e88d41c67a7ec40af90168/chat-items-overlays002.gif)

### Adding a ChatDateTimeOverlay

```C#

ChatDateTimeOverlay dateTimerOverlay = new ChatDateTimeOverlay("Select a date and time", DateTime.Now);
bool showAsPopup = false;
Author author = new Author(Properties.Resources.andrew1, "Andrew");
ChatOverlayMessage overlayMessage = new ChatOverlayMessage(dateTimerOverlay, showAsPopup, author, DateTime.Now);
this.radChat1.AddMessage(overlayMessage);

```

```VB.NET
Dim dateTimerOverlay As ChatDateTimeOverlay = New ChatDateTimeOverlay("Select a date and time", DateTime.Now)
Dim showAsPopup As Boolean = False
Dim author As Author = New Author(My.Resources.andrew1, "Andrew")
Dim overlayMessage As ChatOverlayMessage = New ChatOverlayMessage(dateTimerOverlay, showAsPopup, author, DateTime.Now)
Me.radChat1.AddMessage(overlayMessage)
```

## ChatListOverlay

**ChatListOverlay** offers to the user the ability to select an item from a predefined list of choices.

> caption Figure 3: ChatListOverlay

![WinForms RadChat List Overlay Sample](https://www.telerik.com/products/winforms/documentation/assets/bedec5570d5917937a9fd411f09b01f8/chat-items-overlays003.gif)

### Adding a ChatListOverlay

```C#

ChatListOverlay listOverlay = new ChatListOverlay("List overlay");
for (int i = 0; i < 10; i++)
{
    listOverlay.ListView.Items.Add("Item " + i);
}
bool showAsPopup = false;
Author author = new Author(Properties.Resources.andrew1, "Andrew");
ChatOverlayMessage overlayMessage = new ChatOverlayMessage(listOverlay, showAsPopup, author, DateTime.Now);
this.radChat1.AddMessage(overlayMessage);

```

```VB.NET
Dim listOverlay As ChatListOverlay = New ChatListOverlay("List overlay")
For i As Integer = 0 To 10 - 1
    listOverlay.ListView.Items.Add("Item " & i)
Next

Dim showAsPopup As Boolean = False
Dim author As Author = New Author(My.Resources.andrew1, "Andrew")
Dim overlayMessage As ChatOverlayMessage = New ChatOverlayMessage(listOverlay, showAsPopup, author, DateTime.Now)
Me.radChat1.AddMessage(overlayMessage)
```

You have access to the list view by the ChatListOverlay.**ListView** property.

## ChatTimeOverlay

**ChatTimeOverlay** offers to the user the ability to select time from the picker.

> caption Figure 4: ChatTimeOverlay

![WinForms RadChat Time Overlay Sample](https://www.telerik.com/products/winforms/documentation/assets/76e630d924efb4718b08c66a3a46ffa9/chat-items-overlays004.gif)

### Adding a ChatTimeOverlay

```C#

ChatTimeOverlay calendarOverlay = new ChatTimeOverlay("Select a date and time", DateTime.Now);
bool showAsPopup = false;
Author author = new Author(Properties.Resources.andrew1, "Andrew");
ChatOverlayMessage overlayMessage = new ChatOverlayMessage(calendarOverlay, showAsPopup, author, DateTime.Now);
this.radChat1.AddMessage(overlayMessage);

```

```VB.NET
Dim calendarOverlay As ChatTimeOverlay = New ChatTimeOverlay("Select a date and time", DateTime.Now)
Dim showAsPopup As Boolean = False
Dim author As Author = New Author(My.Resources.andrew1, "Andrew")
Dim overlayMessage As ChatOverlayMessage = New ChatOverlayMessage(calendarOverlay, showAsPopup, author, DateTime.Now)
Me.radChat1.AddMessage(overlayMessage)
```

## See Also

* [Messages](https://www.telerik.com/products/winforms/documentation/controls/chat/chat-items/messages)

* [Cards](https://www.telerik.com/products/winforms/documentation/controls/chat/chat-items/cards)

* [Getting Started](https://www.telerik.com/products/winforms/documentation/controls/chat/getting-started)
