編輯

共用方式為


TaskPanes.Count Property

Definition

Gets a count of the number of the TaskPaneObject objects contained in the collection.

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

Property Value

Remarks

In the following example, the Count property is used within a for loop to iterate through the collection of TaskPane objects. It checks the Visible property of each TaskPane object and if it is true, sets it to false.

TaskPanes taskPanes;

taskPanes = thisXDocument.View.Window.TaskPanes;

for (int i=0; i &lt; taskPanes.<span class="label">Count</span>; i++)   
{
 if (taskPanes[i].Visible == true)
 {
  taskPanes[i].Visible = false;
 }
}

Applies to