是的WinForms ListView控件在VirtualMode有限100,000,000行?是的、控件、WinForms、ListView

2023-09-04 01:26:48 作者:月亮都死了

我有一些电网的情况与> 5亿行,我想展示 在ListView控件。

I have some grid scenario with > 500,000,000 rows I would like to display in ListView.

如果我人为地限制我的ListView显示亿:

If I artificially limit my ListView to display 100,000,000:

 _listView.VirtualListSize = _data.Count;
 if (_listView.VirtualListSize > 100000000)
   _listView.VirtualListSize = 100000000;

一切工作正常(在VirtualMode自然)。 当我改变我的code到:

Everything works fine (In VirtualMode naturally). When I change my code to:

 _listView.VirtualListSize = _data.Count;
 if (_listView.VirtualListSize > 100000001)
   _listView.VirtualListSize = 100000001;

ListView控件显示一个空网格... 这是微软漏洞? 这哪里是哪里来的? 这是一个Win32 ListView的限制吗? 最重要的是,这是为什么没有记载?

The ListView display an empty grid... Is this a Microsoft Bug? Where is this coming from? Is this a Win32 ListView limitation? Most importantly, why is this not documented?

推荐答案

它不能这样做。正如你所发现,亿是绝对的极限。 MS从来没有记录它(据我所知),但限制已经认识了很长一段时间:从2004年的答案。

It can't be done. As you have found, 100,000,000 is the absolute limit. MS never documented it (AFAIK), but the limit has been known for a long time: an answer from 2004.

在previous版本的Windows,试图超过1坠毁操作系统:)

On previous versions of Windows, trying more than 100,000,000 crashed the OS :)

在我的XP和Vista的机器,试图超过1行限制大小为9,999,999。

On my XP and Vista machines, trying more than 100,000,000 rows limits the size to 9,999,999.