本文整理汇总了C#中System.Windows.Forms.ListViewGroup.SetCollapsible方法的典型用法代码示例。如果您正苦于以下问题:C# ListViewGroup.SetCollapsible方法的具体用法?C# ListViewGroup.SetCollapsible怎么用?C# ListViewGroup.SetCollapsible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ListViewGroup
的用法示例。
在下文中一共展示了ListViewGroup.SetCollapsible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: statusBackgroundWorker_RunWorkerCompleted
private void statusBackgroundWorker_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e)
{
ListViewItem[] items = e.Result as ListViewItem[];
if (items == null)
{
label4.Text = "No results";
return;
}
ListViewGroup lvgroup = new ListViewGroup();
statusListView.BeginUpdate();
int running = 0, succeeded = 0, stopped = 0, failed = 0;
for (int i = 0; i < items.Length; i++)
{
if (lvgroup.Header != items[i].Text)
{
lvgroup = new ListViewGroup(items[i].Text);
statusListView.Groups.Add(lvgroup);
lvgroup.SetCollapsible(true);
}
items[i].Group = lvgroup;
statusListView.Items.Add(items[i]);
#if NET_35_OR_GREATER
switch (((CorrelatedTaskEvent)items[i].Tag).RunResult)
{
case CorrelatedTaskEvent.Status.StillRunning:
running++;
break;
case CorrelatedTaskEvent.Status.Success:
succeeded++;
break;
case CorrelatedTaskEvent.Status.Failure:
failed++;
break;
case CorrelatedTaskEvent.Status.Terminated:
stopped++;
break;
default:
break;
}
#endif
}
statusListView.EndUpdate();
statusListView.UseWaitCursor = false;
label4.Text = string.Format(label4.Tag.ToString(), items.Length, running, succeeded, stopped, failed);
}