Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF / XAML TaskbarItemInfo : how to remove blank area for ThumbButtons?

Tags:

xml

wpf

taskbar

I am using Window.TaskbarItemInfo in order to set Overlay icons and show Progress state. This works well, however, even though I have no ThumbButtons set there is still a blank area for those buttons shown below the Thumbnail.

I can easily add buttons but not collapse that area. I tried explicitly setting the ThumbButtonInfos property to null or an empty collection. Any ideas?

like image 435
bgx Avatar asked Oct 12 '25 20:10

bgx


1 Answers

I don't think it's possible with using the WPF provided TaskbarItemInfo.

I would look into the packages called WindowsAPICodePack created by Microsoft.

You have to install this and this for it.

After your window has loaded you can set the overlay icon and progress state through the Microsoft.WindowsAPICodePack.Taskbar.TaskbarManager class. Example:

private void OnLoaded(object sender, RoutedEventArgs routedEventArgs)
{
    var bitmap = new Bitmap("d:\\icon.png"); // or get it from resource
    var iconHandle = bitmap.GetHicon();
    var icon = System.Drawing.Icon.FromHandle(iconHandle);

    TaskbarManager.Instance.SetOverlayIcon(this, icon, "Accessibility Text");
    TaskbarManager.Instance.SetProgressState(TaskbarProgressBarState.Indeterminate, this);
}

Result:

result

You can see that I have an overlay and a progress bar set, but I don't have the empty button panel below the thumbnail.

like image 141
Szabolcs Dézsi Avatar answered Oct 16 '25 05:10

Szabolcs Dézsi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!