TaskPaneCollection Class (Microsoft.Office.InfoPath)
Contains a collection of TaskPane objects that represent the task panes associated with a window in Microsoft Office InfoPath 2007.
Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)
Syntax
'Declaration
<DefaultMemberAttribute("Item")> _
Public MustInherit Class TaskPaneCollection
Implements IEnumerable
'Usage
Dim instance As TaskPaneCollection
[DefaultMemberAttribute("Item")]
public abstract class TaskPaneCollection : IEnumerable
Remarks
The TaskPaneCollection class provides properties that can be used to access TaskPane objects, and it is accessed through the TaskPanes property of the Window class.
Note
The TaskPaneCollection class can be used only to get the count of the TaskPane objects that it contains and to return a reference to a specified TaskPane object. It cannot be used to add or remove TaskPane objects.
Example
The following example sets a reference to the TaskPane object in the TaskPaneCollection with the index value of 3, which corresponds to the Clip Art task pane, and then displays the task pane.
TaskPane myTaskPane = this.TaskPanes[3];
myTaskPane.Visible = true;
Dim myTaskPane As TaskPane = Me.TaskPanes(3)
myTaskPane.Visible = true
Alternatively, you can reference a TaskPane object in the TaskPaneCollection by using a TaskPaneType value, as shown in the following example.
TaskPane myTaskPane = this.TaskPanes[TaskPaneType.ClipArt];
myTaskPane.Visible = true;
Dim myTaskPane As TaskPane = Me.TaskPanes(TaskPaneType.ClipArt)
myTaskPane.Visible = true
Inheritance Hierarchy
System.Object
Microsoft.Office.InfoPath.TaskPaneCollection
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Reference
TaskPaneCollection Members
Microsoft.Office.InfoPath Namespace