Listview

  • Thread starter Ferdinand Zaubzer
  • Start date
F

Ferdinand Zaubzer

Hi!
I am customizing a Listview and I need to determine wether a mouseclick
in the Listview is on the empty area or if it is on an item. All
information I have is the Position of the Mousecursor at the Click and
all my ListviewItems.
I could iterate over all items to determine if the location of the
mouseclick is contained within the Bounds of the item.
Is there any more efficient way?

Thanks
Ferdinand
 
M

Marcel Brekelmans

You can use the ListView.GetItemAt() function (with the mousecursor position
as input) . If there's no item under the mouse it wil return null.
 
F

ForrestPhoto

I think you want to use the HitTest function - look that up on MSDN and
you'll find sample code to do what you need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top