本文整理汇总了C#中ListViewItem.EnsureVisible方法的典型用法代码示例。如果您正苦于以下问题:C# ListViewItem.EnsureVisible方法的具体用法?C# ListViewItem.EnsureVisible怎么用?C# ListViewItem.EnsureVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListViewItem
的用法示例。
在下文中一共展示了ListViewItem.EnsureVisible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: method_4
private void method_4(ExecuteInfo executeInfo_0)
{
ListViewItem listViewItem = new ListViewItem();
ListViewItem arg_20_0 = listViewItem;
int num = ++this.int_5;
arg_20_0.Text = num.ToString();
listViewItem.ImageIndex = 3;
listViewItem.SubItems.Add("<Open connection>");
listViewItem.SubItems.Add(string.Empty);
listViewItem.SubItems.Add(executeInfo_0.StartTime.ToString("HH:mm:ss.fff"));
listViewItem.SubItems.Add(string.Empty);
listViewItem.SubItems.Add(executeInfo_0.AppName);
listViewItem.Tag = executeInfo_0;
listViewItem.ForeColor = Color.Gainsboro;
this.listView1.Items.Add(listViewItem);
this.listView1.SelectedIndices.Clear();
listViewItem.Selected = true;
listViewItem.EnsureVisible();
}
示例2: method_5
private void method_5(ExecuteInfo executeInfo_0)
{
ListViewItem listViewItem = new ListViewItem();
ListViewItem arg_20_0 = listViewItem;
int num = ++this.int_5;
arg_20_0.Text = num.ToString();
listViewItem.ImageIndex = ((executeInfo_0.InfoType == InfoType.StartExecuteSP) ? 0 : 1);
if (!string.IsNullOrEmpty(executeInfo_0.XmlCommandName))
{
listViewItem.SubItems.Add(executeInfo_0.XmlCommandName);
listViewItem.ImageIndex = 4;
}
else
{
listViewItem.SubItems.Add(executeInfo_0.CommandText);
}
listViewItem.SubItems.Add(executeInfo_0.GetParameterValuesShowText());
listViewItem.SubItems.Add(executeInfo_0.StartTime.ToString("HH:mm:ss.fff"));
listViewItem.SubItems.Add(string.Empty);
listViewItem.SubItems.Add(executeInfo_0.AppName);
listViewItem.Tag = executeInfo_0;
if (executeInfo_0.IsWithTranscation)
{
listViewItem.ForeColor = Color.Blue;
}
if (this.bool_0)
{
if (!string.IsNullOrEmpty(executeInfo_0.ExceptionMessage))
{
listViewItem.ImageIndex = 2;
listViewItem.SubItems[4].Text = "执行失败";
listViewItem.ForeColor = Color.Red;
}
else
{
TimeSpan timeSpan = executeInfo_0.EndTime.Value - executeInfo_0.StartTime;
string text = string.Format("{0} ({1}.{2})", executeInfo_0.EndTime.Value.ToString("HH:mm:ss.fff"), timeSpan.Seconds, timeSpan.Milliseconds);
listViewItem.SubItems[4].Text = text;
}
}
this.listView1.Items.Add(listViewItem);
this.listView1.SelectedIndices.Clear();
listViewItem.Selected = true;
listViewItem.EnsureVisible();
}
示例3: AddListViewItem
private void AddListViewItem(ListViewItem Item)
{
if (lvHosts.InvokeRequired)
{
AddListViewItemCB d = new AddListViewItemCB(AddListViewItem);
this.Invoke(d, new object[] { Item });
}
else
{
lvHosts.Items.Add(Item);
Item.EnsureVisible();
}
}