the same way you're doing it now, only instead of adding it to the LV directly, you add it to a list...
I suppose you could keep the original code and simply suspendlayout before the loop and then resumelayout after the loop is done... but I typically will use the code with the addrange ...Code:Dim lvItems as new List(Of ListViewItems) '<-- this is the list we'll add to 'dang, you posted a picture of the code so I can't copy it... 'start your for each -- you have that 'create a new listviewtiem -- you have that lvItems.Add(lsv) ' see, here we add to the list, not the LV directl ' next lsitview1.suspendlayout ' -- this causes the control to not render everytime we add to it... it suspends the layout of hte control listivew1.items.addrange(lvItems) ' -- I think that works as-is ... at worst, you'll need lvItems.ToArray listveiw1.resumelayout ' we're done adding so now we release the control to update itself and it only needs to do it the once.
-tg




Reply With Quote