本文整理匯總了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);
}