Back to Devexpress

Taskbar Assistant

windowsforms-114579-controls-and-libraries-forms-and-user-controls-taskbar-assistant.md

latest7.0 KB
Original Source

Taskbar Assistant

  • Aug 18, 2022
  • 3 minutes to read

The Taskbar Assistant component allows you to customize an application’s button displayed within the Windows taskbar. You can also create custom Jump Lists (when you right-click the taskbar button), add command categories to Jump Lists, add buttons to the toolbar in the thumbnail preview, and display a progress bar and overlay icons.

Run Demo

Taskbar Jump List

The Jump List can contain the following UI elements:

  • General application commands.
  • The Tasks category with custom commands.
  • The Frequent or Recent category with recently used files managed by the Windows shell.
  • Custom categories with custom commands.

When you hover over an application taskbar button, the Taskbar Assistant displays a live thumbnail preview. The preview window can contain a toolbar with up to seven buttons below the preview image (see the screenshot below).

Read the following topic in MSDN for detailed information about the taskbar features: Taskbar Extensions (MSDN).

Task Category

The Taskbar Assistant component ships with the Task Category collection editor integrated into the Visual Studio IDE. The collection editor allows you to easily create and customize tasks, and reorder or remove existing tasks.

Use the JumpListTasksCategory property to access and manage items (tasks) displayed within the Tasks category in code.

csharp
using DevExpress.Utils.Taskbar;
using DevExpress.Utils.Taskbar.Core;

taskbarAssistant1.BeginUpdate();
// Creates a task.
JumpListItemTask task = new JumpListItemTask();
task.Caption = "DevExpress Universal Subscription";
task.Description = "Our most comprehensive software development package.";
task.Path = "https://www.devexpress.com/subscriptions/universal.xml";
task.ShowCommand = WindowShowCommand.Show;

// Adds the task to the Tasks category.
taskbarAssistant1.JumpListTasksCategory.Add(task);
taskbarAssistant1.EndUpdate();
vb
Imports DevExpress.Utils.Taskbar
Imports DevExpress.Utils.Taskbar.Core

taskbarAssistant1.BeginUpdate()
' Creates a task.
Dim task As New JumpListItemTask()
task.Caption = "DevExpress Universal Subscription"
task.Description = "Our most comprehensive software development package."
task.Path = "https://www.devexpress.com/subscriptions/universal.xml"
task.ShowCommand = WindowShowCommand.Show

' Adds the task to the Tasks category.
taskbarAssistant1.JumpListTasksCategory.Add(task)
taskbarAssistant1.EndUpdate()

Custom Categories

The Taskbar Assistant can also display multiple custom categories. Use its Jump List Editor to create custom categories with custom tasks at design time.

Use the JumpListCustomCategories property to access a collection with custom categories in code.

csharp
using DevExpress.Utils.Taskbar;
using DevExpress.Utils.Taskbar.Core;

taskbarAssistant1.BeginUpdate();
// Creates a custom category.
JumpListCategory jumpListCategory = new JumpListCategory("Become a UI Superhero");

// Creates a new task.
JumpListItemTask task = new JumpListItemTask();
task.Caption = "DevExpress Universal Subscription";
task.Description = "Our most comprehensive software development package.";
task.Path = "https://www.devexpress.com/subscriptions/universal.xml";
task.ShowCommand = DevExpress.Utils.Taskbar.Core.WindowShowCommand.Show;

// Adds the task to the custom category.
jumpListCategory.JumpItems.Add(task);

// Adds the custom category to the 'JumpListCustomCategories' collection.
taskbarAssistant1.JumpListCustomCategories.Add(jumpListCategory);
taskbarAssistant1.EndUpdate();
vb
Imports DevExpress.Utils.Taskbar
Imports DevExpress.Utils.Taskbar.Core

taskbarAssistant1.BeginUpdate()
' Creates a custom category.
Dim jumpListCategory As New JumpListCategory("Become a UI Superhero")

' Creates a new task.
Dim task As New JumpListItemTask()
task.Caption = "DevExpress Universal Subscription"
task.Description = "Our most comprehensive software development package."
task.Path = "https://www.devexpress.com/subscriptions/universal.xml"
task.ShowCommand = DevExpress.Utils.Taskbar.Core.WindowShowCommand.Show

' Adds the task to the custom category.
jumpListCategory.JumpItems.Add(task)

' Adds the custom category to the 'JumpListCustomCategories' collection.
taskbarAssistant1.JumpListCustomCategories.Add(jumpListCategory)
taskbarAssistant1.EndUpdate()

Thumbnail Preview Buttons

The Taskbar Assistant can display thumbnail buttons. Use the ThumbnailButtons property to access and manage the thumbnail buttons. Handle the Click event to respond to button clicks.

Progress Indication

The Taskbar Assistant can communicate the application state and display feedback for data intensive operations. Use the ProgressMode property to specify the type of progress visualization.

StateExample
Normal
Paused
Indeterminate
Error
NoneNo progress indication.

Use the ProgressCurrentValue and ProgressMaximumValue properties to configure the progress indication.

Display Overlay Icon

The OverlayIcon property specifies an overlay icon. The Taskbar Assistant displays the overlay icon over the application icon.