Excellent solution Dave!

I actually eliminated the nX variable and used the nYCoord parameter 
rather than building the mouse array and saved several lines.  I'm 
guessing you clipped this from a larger routine where you do additional 
clever things with the extra information.

Thanks again! - Joe

On Wednesday, October 01, 2008  4:47 AM, Dave Crozier wrote:
>
>Date: Wed, 1 Oct 2008 09:47:58 +0100
>From: Dave Crozier
>To: [EMAIL PROTECTED]
>cc:
>Subject: RE: Click and hold selection from a listbox?
>
>Joe,
>A solution for you here.
>
>Assuming that the Listbox is simply placed on a form as its parent (The
>reason why I will explain later):
>
>In the Listbox MouseMove() Method put the following:
>* Start Code
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>
>=Amouseobj(aPosn)
>
>nX=aPosn(3)-This.Left
>nY=aPosn(4)-This.Top
>nTopItem=This.TopItemId
>
>nHeight=Fontmetric(1,This.FontName, This.FontSize)
>nGap=Fontmetric(4,This.FontName, This.FontSize)
>*
>nItem=Int(nY/(nHeight+nGap))+nTopItem
>This.TooltipText=Transform(nItem)
>
>Return
>* End Code
>
>This stores the List Item number of the element you are pointing to in the
>listbox into the TooltipText property of the listbox. I have used this for
>ease of explanation but you could of course use an added property.
>
>
>In the MouseDown() Event if you use the value:
>This.List[Val(This.ToolTipText)]
>
>This will return current selected value in the listbox which is what you
>want. Obviously you can then fire off the image display code for the
>temporary image. Note that this works when there are more items in the
>listbox than can be displayed at once i.e you scroll down.
>
>Dave Crozier
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
>Of Joe Yoder
>Sent: 30 September 2008 18:16
>To: [email protected]
>Subject: re: Click and hold selection from a listbox?
>
>I'm still wondering about this one - I posted this over the weekend and
>got no response.  Maybe there is no way to do what I want and maybe my
>explanation needs revision.  If it's clear and there is no answer I can
>live with what I have.
>
>Thanks - Joe
>
>On Saturday, September 27, 2008 12:24 PM, Joe Yoder wrote:
>>
>>Date: Sat, 27 Sep 2008 12:24:42 -0400
>>From: Joe Yoder
>>To: [EMAIL PROTECTED]
>>cc:
>>Subject: Click and hold selection from a listbox?
>>
>>I have a form used to process image files.  The active image is displayed
>along with a listbox of previously processed image files from a table.  I
>want to allow the user to temporarily display any image from the list to
>verify that the active image is unique and not a duplicate of one already
>processed.
>>
>>I am using the mouse down event to display the temporary image and the
>mouse up event to redisplay to the active one.  This gives the functionality
>I want but when I select a new item from the list, I need to click it twice
>in order to display the proper image.  Apparently the listbox.value property
>is not updated until the mouse up event.  My code reads the value property
>during the mouse down event.  This explains the need for a double select
>when there is a selection change.
>>
>>My intent in choosing the select and hold approach is to prevent confusion
>about which image is being viewed.  The only time a non-active image is
>displayed is when the mouse button is held down.
>>
>>Does someone know of a way to have the listbox approach always work on the
>first click or have another approach to suggest?
>>
>>TIA - Joe
>>
>>
>>--- StripMime Report -- processed MIME parts ---
>>multipart/alternative
>>  text/plain (text body -- kept)
>>  text/html
>>---
>>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to