Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Wanted func to determine height of ListBox row

Hi,
In VBA Excel 2002 I need a way to determine over which row of a ListBox
mouse pointer is.
I know mouse Y position from BeforeDropOrPaste and need to translate it to
actual target row - for the purpose of drop-inserting.
Knowledge Base has an example that doesn't work for me -
http://msdn.microsoft.com/library/de...l/dragdrop.asp
Any known updates to the method?
TIA
Paul


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Wanted func to determine height of ListBox row

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)

"count" wrote in message
...
Hi,
In VBA Excel 2002 I need a way to determine over which row of a ListBox
mouse pointer is.
I know mouse Y position from BeforeDropOrPaste and need to translate it to
actual target row - for the purpose of drop-inserting.
Knowledge Base has an example that doesn't work for me -

http://msdn.microsoft.com/library/de...l/dragdrop.asp
Any known updates to the method?
TIA
Paul




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Wanted func to determine height of ListBox row

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

Użytkownik "Bob Phillips" napisał w
wiadomo¶ci ...
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)

"count" wrote in message
...
Hi,
In VBA Excel 2002 I need a way to determine over which row of a ListBox
mouse pointer is.
I know mouse Y position from BeforeDropOrPaste and need to translate it

to
actual target row - for the purpose of drop-inserting.
Knowledge Base has an example that doesn't work for me -


http://msdn.microsoft.com/library/de...l/dragdrop.asp
Any known updates to the method?
TIA
Paul






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i determine the area under a graph ( distance vrs height) Surfet Charts and Charting in Excel 2 October 23rd 09 04:38 PM
Determine size of listbox Jasper Excel Discussion (Misc queries) 3 April 18th 06 10:38 PM
Drag/drop - calc of ListBox row wanted count Excel Programming 0 May 23rd 04 01:01 AM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM


All times are GMT +1. The time now is 11:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"