"Michael Mattias" <michael.mattias@[EMAIL PROTECTED]
> skrev i melding
news:qjq2g.62783$F_3.15116@[EMAIL PROTECTED]
> "Dankert" <a@[EMAIL PROTECTED]
> wrote in message
> news:kCj2g.563$5J6.505@[EMAIL PROTECTED]
>> Hello,
>>
>> x = ListView_GetSelectionMark(hCtl) 'x contains the correct index
>> number
>> of the item to be deleted
>> ListView_DeleteItem(hCtl,x) 'The item which get deleted is always
item
> x
>> + 2.
>
> If, as your subject line suggests, this is a VIRTUAL listview, you don't
> delete items from it, you use ListView_SetItemCountEx to reduce by one
the
> number of items and adjust the contents of whatever you are using to
> provide the item text when the control asks for it. A real virtual
("real
> virtual?" That's sure oxymoronic!) listview is one created with style
> LVS_OWNERDATA. But you don't show the actual styles used; and in this
case
> it really really makes a difference.
Yes, it is created with the %LVS_OWNERDATA style.
> Further, the GetSelectionMark function itself.... I've have problems
with
> it, so I just use ListView_FindNextItem hCtrl, -1&, LVNI_SELECTED to
find
> the index of the first selected item. I think the problems are related
to
> the fact that GetSelectionMark was designed to find the first selection
of
> multiple selections, not "THE" selected item.
>
> MCM
Thanks, I'll try this approach next time I'm in need of a virtual
listview.Right now a none virtual listview can do, so I changed it to a
such
one.
--
Dankert


|