ListView Headache

ListView Headache

Post by QmVl » Sat, 08 Aug 2009 09:14:01

I have a ListView with a list of images.
The images show sequentially starting with the image clicked (images above
this one do not show).
This is all fine.
However, if I click a image near the top then shift-click an image several
rows below, the _ItemClick event fires for each row within the selection. I
never realized this happened until now so I can see now why some old apps I
wrote are slow.

Unfortuantely this renders each image multiple times and is really sloooow.

Is there a best way to avoid or short circuit the _ItemClick from firing for
all the rows in a shift-click scenario. It is not refiring from within the
event so I cannot set a flag in there to exit.
I need to look at ctrl-click now too.

I see several possibilities for a solution that I have not yet coded but was
wondering is here was some sendmessage or something that is more to the point.

(1) can I capture mouse down (if it occurs before _ItemClick) and flag if
shift is true?
(2) maybe do something with the
ByVal item As MSComctlLib.ListItem
in the _ItemClick line

ListView Headache

Post by DanS » Sun, 09 Aug 2009 02:44:03

=?Utf-8?B?QmVl?= < XXXX@XXXXX.COM > wrote in

If GetAsyncKeyState(VK_SHIFT) then Exit Sub

at the top of the _ItemClick event may work.


ListView Headache

Post by QmVl » Mon, 10 Aug 2009 01:10:01

Will give it a try. Thanks.
In the mean time I have coded in a timer to get around this but it adds
another control and I am running out of controls.