Re: ListView crashes program why?
- Posted by Matthew Lewis <MatthewL at KAPCOUSA.COM> Jan 18, 2001
- 423 views
-----Original Message----- From: Tony Steward >Hi all, >It seems that if I use the line >if deleteItem( LV, -1) then end if > On any LV and then switch to another tab control or > window containing another LV that it causes a crash. > Has anyone experienced / solved this problem. This is a bug in deleteItem(). Basically, it was deleting ALL listview items, not just those belonging to the listview in question. You can change the elsif clause in deleteItem() to what I have below here, and it will work like it should: elsif window_type[ id ] = ListView then if pos = -1 then msg = LVM_DELETEALLITEMS iItem = 1 while iItem <= length( lvitem_owner ) do if lvitem_owner[iItem] = id then removeLVItem( iItem ) if iItem < length(lvitem_owner) then iItem += 1 end if else iItem += 1 end if end while Matt Lewis