开发者

App responsiveness during loop

开发者 https://www.devze.com 2023-02-11 00:39 出处:网络
I have designed an app in vb.net 2005 that at one point adds and loops over about 500k list in listbox about.

I have designed an app in vb.net 2005 that at one point adds and loops over about 500k list in listbox about.

When adding these items to the listbox, the app freezes for about 5-10 minutes, then when looping over the items, processing them, the app also freezes for the same开发者_运维技巧 time. Am loading the data from a text file

  1. How can I make my application responsive during loops?
  2. should I use a queue to process the list?
  3. what is the messagequeue control for?


I recommend you to use BackgroundWorker. Store items in array, and bind listbox to it. Working with array will be much faster then with listbox'es collection.

Or you can call BeginUpdate/EndUpdate before/after adding new items.

0

精彩评论

暂无评论...
验证码 换一张
取 消