As shown in the screenshot, my ProgressBar1.Value
updates properly, but not my TaskbarItemInfo.ProgressValue
:
This is the code I am using to update both:
void bw_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
// Set the Value porperty when progress changed.
this.ProgressBar1.Value = (double)e.ProgressPercentage;
this.TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal;
this.TaskbarItemInfo.ProgressValue = e.ProgressPercentage / 100;
}
How can I make my TaskbarItemInfo
update properly?
this.TaskbarItemInfo.ProgressValue = e.ProgressPercentage / 100;
It looks to me that you are dividing an int with another int therefore the result will be an int when a double is expected.
Simply try to suffix 100 with a "d" (making it a double) :
this.TaskbarItemInfo.ProgressValue = e.ProgressPercentage / 100d;