ListViewGroupCollection.Add 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 a ListViewGroup to the collection.
Overloads
Add(ListViewGroup) |
Adds the specified ListViewGroup to the collection. |
Add(String, String) |
Adds a new ListViewGroup to the collection using the specified values to initialize the Name and Header properties. |
Add(ListViewGroup)
Adds the specified ListViewGroup to the collection.
public:
int Add(System::Windows::Forms::ListViewGroup ^ group);
public int Add (System.Windows.Forms.ListViewGroup group);
member this.Add : System.Windows.Forms.ListViewGroup -> int
Public Function Add (group As ListViewGroup) As Integer
Parameters
- group
- ListViewGroup
The ListViewGroup to add to the collection.
Returns
The index of the group within the collection, or -1 if the group is already present in the collection.
Exceptions
group
contains at least one ListViewItem that belongs to a ListView control other than the one that owns this ListViewGroupCollection.
The ListView that this collection is assigned to is in virtual mode.
Remarks
Use this method to add an existing ListViewGroup to the collection. You cannot add a ListViewGroup to the collection more than once. When you call the Add method using a ListViewGroup that is already in the collection, the addition fails and -1 is returned.
To add multiple groups to the collection, use the AddRange method.
See also
Applies to
Add(String, String)
Adds a new ListViewGroup to the collection using the specified values to initialize the Name and Header properties.
public:
System::Windows::Forms::ListViewGroup ^ Add(System::String ^ key, System::String ^ headerText);
public System.Windows.Forms.ListViewGroup Add (string key, string headerText);
public System.Windows.Forms.ListViewGroup Add (string? key, string? headerText);
member this.Add : string * string -> System.Windows.Forms.ListViewGroup
Public Function Add (key As String, headerText As String) As ListViewGroup
Parameters
Returns
The new ListViewGroup.
Exceptions
The ListView that this collection is assigned to is in virtual mode.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기