Version

PercentComplete Property

Returns or sets a floating-point value indicating the percent of completion for the task, with the value zero representing a task that has not yet been started, and the value of 100 representing a task that has been fully completed.
Syntax
'Declaration
 
Public Property PercentComplete As Single
public float PercentComplete {get; set;}
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeExceptionThrown when the value is less than zero or greater than 100.
Remarks

The PercentComplete property cannot be set for summary tasks; attempting to do so causes an ArgumentOutOfRangeException to be thrown.

The value returned from this property for summary tasks is an approximation, derived by adding the PercentComplete for each descendant task that is not itself a summary, and dividing that value by the number of descendant tasks that are not summaries. For example, consider a summary task with three sub-tasks, each with no sub-tasks of their own. the value of PercentComplete is set at 50% for the first task, 0% for the second, and 25% for the third. The total percentage of completion (75), is divided by the number of sub-tasks (3), yielding a value of 25% for the summary task.

THe value returned from this property is rounded to two decimal places.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also