progress bar on taskbar icon using winforms .net 6 vb.net

966 Views Asked by At

I am having a hard time finding a solution to display the status of a progressbar on the taskbar icon on Windows 10/11. Do you have suggestions. I use Winforms with VB.Net .Net 6.

enter image description here

2

There are 2 best solutions below

1
user18387401 On

I'm not 100% sure as it's not something that I've done myself but I think that you can use the Microsoft.Windows.SDK.Contracts package for that. I believe that that is what replaced the WindowsAPICodePack package.

0
volante089 On

thanks to all the same, I solved it like this:

installed package NuGet: "Microsoft-WindowsAPICodePack-Core" by rpastric, contre, dahall

'Imports
Imports Microsoft.WindowsAPICodePack.Taskbar

        Dim stato_istanza = TaskbarProgressBarState.Normal
        Dim istanza = TaskbarManager.Instance
        istanza.SetProgressState(stato_istanza)
        istanza.SetProgressValue(value, valuemax)

All tested and working with Winforms VB.Net with .Net 6.0 and Visual Studio 2022