Search code examples
c#winformswindows-7progress-barminimized

Show a progressbar in taskbar while form is minimized


I wonder how can i accomplish the following:

I would like to display the progress of a progressbar on the taskbar while my window is minimized. See here for a visual description.

See how the icon on the taskbar gradually fills with green color following the main progressbar in the window?

Could someone tell me how to do that?

Update:

I downloaded windows api code pack and referenced it in my project and wrote the following code but nothing happens when i run my app increment the pbar and minimize:

    private void updatepbar()
    { 
        tpb.Value = progressBar1.Value;
    }

        timer1.Tick += new EventHandler(delegate { updatepbar(); });
        timer1.Interval = 1000;
        timer1.Start();

What am i doing wrong? thanks alot


Solution

  • http://windowsteamblog.com/windows/b/developers/archive/2009/07/28/windows-7-taskbar-dynamic-overlay-icons-and-progress-bars.aspx

    Taskbar.ProgressBar.State = 
    (TaskbarButtonProgressState)Enum.Parse(
            typeof(TaskbarButtonProgressState), 
            (string)comboBoxProgressBarStates.SelectedItem);
    
    if (Taskbar.ProgressBar.State != TaskbarButtonProgressState.Indeterminate)
       Taskbar.ProgressBar.CurrentValue = progressBar1.Value;