Edit

Share via


TaskPaneCollection Class

Definition

Contains a collection of TaskPane objects that represent the task panes associated with a window in Microsoft InfoPath.

public ref class TaskPaneCollection abstract : System::Collections::IEnumerable
public abstract class TaskPaneCollection : System.Collections.IEnumerable
type TaskPaneCollection = class
    interface IEnumerable
Public MustInherit Class TaskPaneCollection
Implements IEnumerable
Inheritance
TaskPaneCollection
Implements

Examples

The following example sets a reference to the TaskPane object in the TaskPaneCollection with the index value of 1, which corresponds to the Clip Art task pane, and then displays the task pane.

TaskPane myTaskPane = this.TaskPanes[1];
myTaskPane.Visible = true;
Dim myTaskPane As TaskPane  = Me.TaskPanes(1)
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

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.

Constructors

TaskPaneCollection()

Properties

Count

Gets a count of the TaskPane objects contained in the collection.

Item[Int32]

Gets a reference to the specified TaskPane object from the collection by index value.

Item[TaskPaneType]

Gets a reference to the specified TaskPane object from the collection by enumerated type.

Methods

GetEnumerator()

Gets an IEnumerator that iterates over all entries in the TaskPaneCollection collection.

Applies to