ListView.SelectedIndexCollection.Add(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds the item at the specified index in the Items array to the collection.
public:
int Add(int itemIndex);
public int Add (int itemIndex);
member this.Add : int -> int
Public Function Add (itemIndex As Integer) As Integer
Parameters
- itemIndex
- Int32
The index of the item in the Items collection to be added to the ListView.SelectedIndexCollection.
Returns
The number of items in the ListView.SelectedIndexCollection.
Exceptions
The specified index is less than 0 or greater than or equal to the number of items in the owner ListView.
-or-
The owner ListView is in virtual mode, and the specified index is less than 0 or greater than or equal to the value of VirtualListSize.
Remarks
This method will return 0 if the handle has not been created for the owning ListView. (You can determine whether the ListView has an associated handle by using the Control.IsHandleCreated property.) This method will return -1 if the handle has not been created for a virtual ListView.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應