.Net 2.0为提供的ListView控件和1.1提供了分组和平铺视图两个新功能。这些功能需要在Windows XP或者Windows 2003上面才能表现出来。

效果图如下:
.Net 2.0ListView控件在Windows 2000和Windows XP上的差异
再Windows2000下面除了显示效果和以前一样以外,今天还发现下面这个问题。ListViewGroup.Count属性不会随ListView.Items.Clear()方法影响。

ListView listView = new ListView();
ListViewGroup localGroup 
= new ListViewGroup("本地用户");
listView.Groups.Add(localGroup);

ListViewItem item 
= new ListViewItem("张山", localGroup);

// 此时 localGroup.Items.Count 等于 1

listView.Items.Clear();

// 此时在Windows XP、Windows 2003环境下
// localGroup.Items.Count 等于 0
//
// 而在Windows 2000 环境下
// localGroup.Items.Count 仍然等于1。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2021-06-22
  • 2021-10-07
猜你喜欢
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2021-11-02
  • 2021-12-12
相关资源
相似解决方案