Wanted func to determine height of ListBox row

B

Bob Phillips

Paul,

Surely the Y position cannot relate to a row, as in one instance the mouse
could be over a row that is 3rd in the visible list, in another it could be
over the same row, but that row is 4th in the visible list.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
C

count

Thanks Bob,
Yes, this is a problem and ListBox has TopIndex to address it - I think.
Still, I need method or "user32" function to answer me how high each of
ListBox lines is. It used to be available in olden 16-bit days.

The issue is that the code may be used on a pc, where font <> Tahoma 8 pt
and then this calculation:
TargetRow = ListBox1.TopIndex + Int((Y + 4.5) / 10)
will not do anymore.
Thanks again
Paul
 

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