Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

TaskItems Collection

Visual Studio .NET 2003

The TaskItems collection contains all of the tasks in the Task List window.

DTE

   Windows

      Window

         TaskList

            TaskItems

[Visual Basic .NET]
Public Interface TaskItems
    Inherits IDispatch
[Visual Basic 6]
Class TaskItems
[C++]
interface TaskItems : IDispatch
[C#]
public interface TaskItems : IDispatch
[JScript .NET]
public interface TaskItems extends IDispatch

Requirements

Namespace: EnvDTE

File: dte.olb

Example

Sub TaskItemsCollectionExample()
   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

See Also

Properties, Methods, and Events | TaskItem Object | TaskList Object | TaskItems Property

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.