New to Telerik UI for WinForms? Download free 30-day trial

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

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.

Figure 1: ChatCalendarOverlay

WinForms RadChat Calendar Overlay Sample

Adding a ChatCalendarOverlay

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);

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.

Figure 2: ChatDateTimeOverlay

WinForms RadChat DateTime Overlay Sample

Adding a ChatDateTimeOverlay

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);

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.

Figure 3: ChatListOverlay

WinForms RadChat List Overlay Sample

Adding a ChatListOverlay

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);

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.

Figure 4: ChatTimeOverlay

WinForms RadChat Time Overlay Sample

Adding a ChatTimeOverlay

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);

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

In this article