Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

TaskList Interface

The TaskList object represents the items in the Task List window in the Visual Studio integrated development environment (IDE).

Namespace: EnvDTE
Assembly: EnvDTE (in envdte.dll)

[GuidAttribute("4E4F0569-E16A-4DA1-92DE-10882A4DDD8C")] 
public interface TaskList
/** @attribute GuidAttribute("4E4F0569-E16A-4DA1-92DE-10882A4DDD8C") */ 
public interface TaskList
GuidAttribute("4E4F0569-E16A-4DA1-92DE-10882A4DDD8C") 
public interface TaskList

There is only one TaskList object in the IDE.

Sub TaskListExample()
   Dim win As Window = DTE.Windows.Item(Constants.vsWindowKindTaskList)
   Dim TL As TaskList = win.Object
   Dim TLItem As TaskItem

   ' Add a couple of tasks to the Task List.
   TLItem = TL.TaskItems.Add(" ", " ", "Test task 1.", vsTaskPriority.vsTaskPriorityHigh, vsTaskIcon.vsTaskIconUser, True, , 10, , )
   TLItem = TL.TaskItems.Add(" ", " ", "Test task 2.", vsTaskPriority.vsTaskPriorityLow, vsTaskIcon.vsTaskIconComment, , 20, , )

   ' List the total number of task list items after adding the new 
   ' task items.
   MsgBox("Task Item 1 description: " & TL.TaskItems.Item(2).Description)
   MsgBox("Total number of task items: " & TL.TaskItems.Count)

   ' Remove the second task item. The items list in reverse numeric order.
   MsgBox("Deleting the second task item")
   TL.TaskItems.Item(1).Delete()
   MsgBox("Total number of task items: " & TL.TaskItems.Count)
End Sub

Community Additions

ADD
Show:
© 2015 Microsoft