本文整理汇总了C#中System.Windows.Forms.ListView.Hide方法的典型用法代码示例。如果您正苦于以下问题:C# ListView.Hide方法的具体用法?C# ListView.Hide怎么用?C# ListView.Hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ListView
的用法示例。
在下文中一共展示了ListView.Hide方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AutoResize
/// <summary>
/// resize all columns to best fit the header and the contents
/// </summary>
/// <param name="lv">The lv.</param>
public static void AutoResize(ListView lv)
{
lv.Hide();
foreach (ColumnHeader CH in lv.Columns)
{
AutoResizeListViewColumn(lv, CH);
}
lv.Show();
}
示例2: SwapIndicies
/// <summary>
/// swap two rows given by their index
/// </summary>
/// <param name="lv">The lv.</param>
/// <param name="index1">First Index to Swap</param>
/// <param name="index2">Second Index to Swap</param>
public static void SwapIndicies(ListView lv, int index1, int index2)
{
lv.Hide();
if (index1 < 0 || index2 < 0 || index1 >= lv.Items.Count || index2 >= lv.Items.Count)
return;
//make clones
var LVI1 = (ListViewItem) lv.Items[index1].Clone();
var LVI2 = (ListViewItem) lv.Items[index2].Clone();
//swap the sub items
lv.Items[index1].SubItems.Clear();
lv.Items[index1].SubItems.AddRange(SubItemCollectionToRange(LVI2.SubItems));
lv.Items[index2].SubItems.Clear();
lv.Items[index2].SubItems.AddRange(SubItemCollectionToRange(LVI1.SubItems));
//swap the name and text
lv.Items[index1].Text = LVI1.Text;
lv.Items[index2].Text = LVI2.Text;
lv.Items[index1].Name = LVI1.Text;
lv.Items[index2].Name = LVI2.Text;
lv.Show();
}