Features > Task Management > Milestone Task |
A milestone task, or simply a milestone, is used for accounting an important event(s) within a project schedule. This feature helps users in keeping a track of their planned goals. For example, you can create a milestone to mark events such as the completion of a major phase in project schedule or indicate the beginning of the next project phase, etc. Since milestones do not include or account for any work, these are created as tasks with zero duration.
GanttView supports milestones, which can be created as a task with the Duration property set to zero, and the Start and the Finish properties set to the same date. Milestone tasks can also be created at the design-time through the Task Collection Editor available in the properties window. In GanttView, a milestone task is represented by a diamond-shaped item in the chart view.
The following image shows a GanttView displaying a milestone task by the name "Project Review - Phase 1".
To create a milestone task, you need to define an instance of the Task class, and set the Duration, Start and Finish properties in code. The following example uses the sample created in the Quick Start.
'Creating a milestone task Dim t As New Task() t.Name = "Project Review - Phase 1" t.Start = New DateTime(2016, 4, 29) t.Finish = New DateTime(2016, 4, 29) t.Duration = 0 'Adding milestone task to gantt view gv.Tasks.Add(t)
//Creating a milestone task Task t = new Task(); t.Name = "Project Review - Phase 1"; t.Start = new DateTime(2016, 4, 29); t.Finish = new DateTime(2016, 4, 29); t.Duration = 0; //Adding milestone task to gantt view gv.Tasks.Add(t);