ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Func wanted for drag/drop in ListBox (https://www.excelbanter.com/excel-programming/299414-func-wanted-drag-drop-listbox.html)

count

Func wanted for drag/drop in ListBox
 
Hi,
I need a method or some "user32" function to answer me how high each of
ListBox lines actually is. It used to be available in olden 16-bit days.

This is needed for calculating target ListBox item, where we finally drop
the dragged stuff. MSForms provides useful value of mouse Y for that
precise moment. For a given font (like Tahoma 8) calculation is easy:
TargetRow = ListBox1.TopIndex + Int((Y + 4.5) / 10) '4.5
used to skip top half-line
- however it will fail miserably when e.g. system substitues this font or
some other video related change happens.
So, I need to know the height of each line...
Thanks in advance
Paul




All times are GMT +1. The time now is 03:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com