List.ListItems プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
Listの内容を構成するListItem要素を含むListItemCollectionを取得します。
public:
property System::Windows::Documents::ListItemCollection ^ ListItems { System::Windows::Documents::ListItemCollection ^ get(); };
public System.Windows.Documents.ListItemCollection ListItems { get; }
member this.ListItems : System.Windows.Documents.ListItemCollection
Public ReadOnly Property ListItems As ListItemCollection
プロパティ値
Listの内容を構成するListItem要素を含むListItemCollection。
このプロパティには既定値はありません。
例
次の例では、ListItems プロパティを使用してListに対して一般的な操作を実行する方法を示します。
// Add ListItems to the List.
List listx = new List();
Span spanx = new Span();
listx.ListItems.Add(new ListItem(new Paragraph(new Run("A bit of text content..."))));
listx.ListItems.Add(new ListItem(new Paragraph(new Run("A bit more text content..."))));
// Insert a ListItem at the begining of the List.
ListItem lix = new ListItem(new Paragraph(new Run("ListItem to insert...")));
listx.ListItems.InsertBefore(listx.ListItems.FirstListItem, lix);
// Get the number of ListItems in the List.
int countListItems = listx.ListItems.Count;
// Remove the last ListItem from the List.
listx.ListItems.Remove(listx.ListItems.LastListItem);
// Clear all of the ListItems from the List.
listx.ListItems.Clear();
' Add ListItems to the List.
Dim listx As New List()
Dim spanx As New Span()
listx.ListItems.Add(New ListItem(New Paragraph(New Run("A bit of text content..."))))
listx.ListItems.Add(New ListItem(New Paragraph(New Run("A bit more text content..."))))
' Insert a ListItem at the begining of the List.
Dim lix As New ListItem(New Paragraph(New Run("ListItem to insert...")))
listx.ListItems.InsertBefore(listx.ListItems.FirstListItem, lix)
' Get the number of ListItems in the List.
Dim countListItems As Integer = listx.ListItems.Count
' Remove the last ListItem from the List.
listx.ListItems.Remove(listx.ListItems.LastListItem)
' Clear all of the ListItems from the List.
listx.ListItems.Clear()
注釈
このプロパティによって返される ListItemCollection を使用して、 List 要素の内容を列挙または操作します。