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

Thumbnail Buttons

The RadTaskbarButton control can display buttons in its thumbnail part. Adding buttons to your thumbnail preview will be an excellent enhancement to your application. This way the user can call commands in your application without restoring or activating the application's window. To add thumbnail button, you can populate the ThumbnailButtons collection of the control.

Telerik.WinControls.Taskbar.RadThumbnailButton radThumbnailButton1 = new Telerik.WinControls.Taskbar.RadThumbnailButton();
Telerik.WinControls.Taskbar.RadThumbnailButton radThumbnailButton2 = new Telerik.WinControls.Taskbar.RadThumbnailButton();

Dim radThumbnailButton1 As Telerik.WinControls.Taskbar.RadThumbnailButton = New Telerik.WinControls.Taskbar.RadThumbnailButton()
Dim radThumbnailButton2 As Telerik.WinControls.Taskbar.RadThumbnailButton = New Telerik.WinControls.Taskbar.RadThumbnailButton()

Figure 1 demonstrate the above code snippet. You can observe that the buttons appears in the thumbnail preview but their content is empty.

Figure 1: Thumbnail Buttons

WinForms RadTaskbarButton Thumbnail Buttons

To add image content to the buttons, you can populate the ThumbnailButtonsImageList collection of the RadTaskbarButton with the required images. Then you can set the ImageIndex property of each button to the index of image inside the collection.

var images = new ImageList();
images.Images.Add(new Bitmap("../../ProgressIcon.ico"));
images.Images.Add(new Bitmap("../../WinFormsIcon.ico"));
this.radTaskbarButton1.ThumbnailButtonsImageList = images;
this.radTaskbarButton1.ThumbnailButtons[0].ImageIndex = 0;
this.radTaskbarButton1.ThumbnailButtons[1].ImageIndex = 1;

Dim images = New ImageList()
images.Images.Add(New Bitmap("../../ProgressIcon.ico"))
images.Images.Add(New Bitmap("../../WinFormsIcon.ico"))
Me.RadTaskbarButton1.ThumbnailButtonsImageList = images
Me.RadTaskbarButton1.ThumbnailButtons(0).ImageIndex = 0
Me.RadTaskbarButton1.ThumbnailButtons(1).ImageIndex = 1

Figure 2: Add Image

WinForms RadTaskbarButton Thumbnail Buttons Image

Click Event

To distingues which button is click by the user and execute application logic, you can subscribe to the ThumbnailButtonClick event of the RadTaskbarButton. In the event handler you can get the pressed button from the event arguments.

Non Interactive State

There could be requirement to add non interactive icon in the buttons section inside the thumbnail preview. To simulate this effect you can use the NonBackground and NonInteractive properties. The first one will remove the border rectangle and mouse hover effects and the second one will disable the button press event.

this.radTaskbarButton1.ThumbnailButtons[0].NoBackground = true;
this.radTaskbarButton1.ThumbnailButtons[0].NonInteractive = true;

Me.RadTaskbarButton1.ThumbnailButtons(0).NoBackground = True
Me.RadTaskbarButton1.ThumbnailButtons(0).NonInteractive = True

Figure 3: NonInteractive Button

WinForms RadTaskbarButton NonInteractive Button

See Also

In this article