中の技術日誌ブログ

C#とC++/CLIと
VBと.NETとWindowsで戯れる
 

目次

Blog 利用状況

ニュース

自己紹介

東京でソフトウェアエンジニアをやっています。
お仕事大募集中です。
記事執筆や、講師依頼とかでも何でもどうぞ(*^_^*)
似顔絵 MSMVPロゴ
MSMVP Visual C# Since 2004/04-2013/03

記事カテゴリ

書庫

日記カテゴリ

00-整理

01-MSMVP

.NET2.0 ListViewの仮想化

.NET1.xではListViewに以下のようにすべてのアイテムを追加していました。

this.listView1.BeginUpdate();
this.listView1.Items.Clear();
for (int i = 0; i < 10000; i++)
{
 this.listView1.Items.Add(i.ToString());
}
this.listView1.EndUpdate();

ただしこれはListViewに1万個のアイテムを保持することにもなり、非常にリソースを使います。

.Net 2.0では仮想リストビューがサポートされています。

this.listView1.VirtualMode = true;
this.listView1.VirtualListSize = 10000;

仮想を宣言

   this.listView1.RetrieveVirtualItem += new System.Windows.Forms.RetrieveVirtualItemEventHandler(this.listView1_RetrieveVirtualItem);

RetrieveVirtualItem イベントを宣言

private void listView1_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
{
 e.Item = new ListViewItem(e.ItemIndex.ToString());
}

実装

これで完了です。

実際にはListViewItemを配列で保持したりすることで、代入するだけですし簡単ですね。

投稿日時 : 2006年2月13日 16:49

コメントを追加

# ListView(System.Windows.Forms.ListView) 2007/02/08 10:25 主婦と.NETと犬のぶろぐ

ListView(System.Windows.Forms.ListView)

# re: .NET2.0 ListViewの仮想化 2009/07/01 23:03 ccbest

那个CacheVirtualItem怎?用?

# Now I am ready to do my breakfast, once having my breakfast coming again to read more news. 2021/08/28 15:41 Now I am ready to do my breakfast, once having my

Now I am ready to do my breakfast, once having my breakfast coming again to read more news.

# Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She placed the shell to her ear and screamed. There was a hermit crab insid 2021/08/30 19:43 Today, I went to the beach front with my kids. I f

Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year
old daughter and said "You can hear the ocean if you put this to your ear." She placed
the shell to her ear and screamed. There was a hermit
crab inside and it pinched her ear. She never wants to go back!
LoL I know this is completely off topic but I had to tell someone!

# Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She placed the shell to her ear and screamed. There was a hermit crab insid 2021/08/30 19:44 Today, I went to the beach front with my kids. I f

Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year
old daughter and said "You can hear the ocean if you put this to your ear." She placed
the shell to her ear and screamed. There was a hermit
crab inside and it pinched her ear. She never wants to go back!
LoL I know this is completely off topic but I had to tell someone!

# Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She placed the shell to her ear and screamed. There was a hermit crab insid 2021/08/30 19:45 Today, I went to the beach front with my kids. I f

Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year
old daughter and said "You can hear the ocean if you put this to your ear." She placed
the shell to her ear and screamed. There was a hermit
crab inside and it pinched her ear. She never wants to go back!
LoL I know this is completely off topic but I had to tell someone!

# Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She placed the shell to her ear and screamed. There was a hermit crab insid 2021/08/30 19:46 Today, I went to the beach front with my kids. I f

Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year
old daughter and said "You can hear the ocean if you put this to your ear." She placed
the shell to her ear and screamed. There was a hermit
crab inside and it pinched her ear. She never wants to go back!
LoL I know this is completely off topic but I had to tell someone!

# Excellent blog you have here but I was curious if you knew of any discussion boards that cover the same topics talked about in this article? I'd really like to be a part of online community where I can get opinions from other knowledgeable individuals 2021/09/03 1:09 Excellent blog you have here but I was curious if

Excellent blog you have here but I was curious if you
knew of any discussion boards that cover the same topics talked
about in this article? I'd really like to be a part of online community where I can get opinions from other knowledgeable individuals that share the same interest.
If you have any recommendations, please let me know. Bless you!

# Excellent blog you have here but I was curious if you knew of any discussion boards that cover the same topics talked about in this article? I'd really like to be a part of online community where I can get opinions from other knowledgeable individuals 2021/09/03 1:10 Excellent blog you have here but I was curious if

Excellent blog you have here but I was curious if you
knew of any discussion boards that cover the same topics talked
about in this article? I'd really like to be a part of online community where I can get opinions from other knowledgeable individuals that share the same interest.
If you have any recommendations, please let me know. Bless you!

# Excellent blog you have here but I was curious if you knew of any discussion boards that cover the same topics talked about in this article? I'd really like to be a part of online community where I can get opinions from other knowledgeable individuals 2021/09/03 1:11 Excellent blog you have here but I was curious if

Excellent blog you have here but I was curious if you
knew of any discussion boards that cover the same topics talked
about in this article? I'd really like to be a part of online community where I can get opinions from other knowledgeable individuals that share the same interest.
If you have any recommendations, please let me know. Bless you!

# Excellent blog you have here but I was curious if you knew of any discussion boards that cover the same topics talked about in this article? I'd really like to be a part of online community where I can get opinions from other knowledgeable individuals 2021/09/03 1:12 Excellent blog you have here but I was curious if

Excellent blog you have here but I was curious if you
knew of any discussion boards that cover the same topics talked
about in this article? I'd really like to be a part of online community where I can get opinions from other knowledgeable individuals that share the same interest.
If you have any recommendations, please let me know. Bless you!

# It's going to be finish of mine day, except before finish I am reading this impressive post to improve my know-how. part time jobs hired in 30 minutes https://parttimejobshiredin30minutes.wildapricot.org/ 2021/10/22 20:12 It's going to be finish of mine day, except before

It's going to be finish of mine day, except before finish I am reading this impressive post to improve my know-how.

part time jobs hired in 30 minutes https://parttimejobshiredin30minutes.wildapricot.org/

# clomid dosage http://clomidfast.site/ 2022/04/12 12:24 Clomids

clomid dosage http://clomidfast.site/

# WLySuaXebyvCajFX 2022/04/19 12:17 johnansaz

http://imrdsoacha.gov.co/silvitra-120mg-qrms

# finasteride hair loss https://finasteridemen.com/
2022/05/11 14:24 Finasteride

finasteride hair loss https://finasteridemen.com/

# Today, I went to the beach with my kids. I found a sea shell and gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She put the shell to her ear and screamed. There was a hermit crab inside and it 2022/06/09 1:02 Today, I went to the beach with my kids. I found a

Today, I went to the beach with my kids. I found a sea shell and gave it to my 4 year
old daughter and said "You can hear the ocean if you put this to your ear." She put the shell to her ear
and screamed. There was a hermit crab inside and it pinched her ear.
She never wants to go back! LoL I know this is completely off topic but I had to tell someone!

# lasix online https://buylasix.icu/
lasix side effects 2022/06/24 16:37 LasixRx

lasix online https://buylasix.icu/
lasix side effects

# clomid buy https://clomidonline.icu/ 2022/07/08 13:04 Clomidj

clomid buy https://clomidonline.icu/

# ivermectin for demodex https://stromectolbestprice.com/ 2022/07/29 23:59 BestPrice

ivermectin for demodex https://stromectolbestprice.com/

# order prednisone 10 mg tablet https://deltasone.icu/
prednisone 60 mg price 2022/08/22 9:13 Prednisone

order prednisone 10 mg tablet https://deltasone.icu/
prednisone 60 mg price

# metformin buy canada https://glucophage.top/
where to buy metformin tablets 2022/08/23 7:23 Niujsdkj

metformin buy canada https://glucophage.top/
where to buy metformin tablets

# best male enhancement pills https://ed-pills.xyz/
buying ed pills online 2022/09/15 18:45 EdPills

best male enhancement pills https://ed-pills.xyz/
buying ed pills online

# the best ed pills https://ed-pills.xyz/
ed treatment review 2022/09/17 19:25 EdPills

the best ed pills https://ed-pills.xyz/
ed treatment review

# doxycycline medication https://buydoxycycline.icu/ 2022/10/08 11:38 Doxycycline

doxycycline medication https://buydoxycycline.icu/

# cheap prednisone online https://prednisonepills.site/
50 mg prednisone tablet 2022/11/30 0:31 Prednisone

cheap prednisone online https://prednisonepills.site/
50 mg prednisone tablet

# doors2.txt;1 2023/03/14 15:30 OjSzOZroLAxBQBDbMZ

doors2.txt;1

# buy prednisone from india - https://prednisonesale.pro/# 2023/04/22 4:36 Prednisone

buy prednisone from india - https://prednisonesale.pro/#

# buy cytotec pills - https://cytotecsale.pro/# 2023/04/29 4:47 Cytotec

buy cytotec pills - https://cytotecsale.pro/#

# prednisone rx coupon https://prednisonepills.pro/# - 10 mg prednisone 2023/06/04 21:21 Prednisone

prednisone rx coupon https://prednisonepills.pro/# - 10 mg prednisone

# ï»¿paxlovid https://paxlovid.life/# paxlovid covid 2023/07/25 20:32 Paxlovid

paxlovid https://paxlovid.life/# paxlovid covid

# naked dating 2023/08/09 19:35 WayneGurry

free chat online singles: https://datingtopreview.com/# - connect singles

# buy cytotec pills online cheap 2023/08/27 19:53 Georgejep

https://misoprostol.guru/# order cytotec online

# farmacia online migliore 2023/09/24 17:23 Archieonelf

https://onlineapotheke.tech/# online apotheke preisvergleich

# farmacia online senza ricetta 2023/09/25 16:15 Archieonelf

http://pharmacieenligne.icu/# Pharmacie en ligne livraison 24h

# erection pills that work https://edpillsotc.store/# - ed meds online 2023/10/08 1:17 EdPills

erection pills that work https://edpillsotc.store/# - ed meds online

# cure ed 2023/10/08 7:37 BobbyAtobe

Long-Term Effects. https://doxycyclineotc.store/# doxycycline prices canada

# ed pills otc 2023/10/09 7:42 BobbyAtobe

A gem in our community. http://doxycyclineotc.store/# buy doxycycline 100mg capsules online

# farmacie online autorizzate elenco https://farmaciait.pro/ farmacia online più conveniente 2023/12/04 10:18 Farmacia

farmacie online autorizzate elenco https://farmaciait.pro/ farmacia online più conveniente

# buying ed pills online https://edpills.tech/# cheapest ed pills 2023/12/23 8:16 EdPills

buying ed pills online https://edpills.tech/# cheapest ed pills

タイトル
名前
URL
コメント