Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drag and Drop Question
Message
From
29/10/1997 16:39:49
 
 
To
29/10/1997 16:26:51
Edward Crawford
City Facilities Management
Glasgow, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00057264
Message ID:
00057290
Views:
31
>>>I have two list boxes. One list box has a list of account numbers. The second list box is made up of people associated with each account. If you move to a different account, the people change with the account. I want to be able to click on a person and drag them over to another account and drop them into a different account. The problem is when I drag the item to the other listbox, how can I find out what ListItem the cursor is over so that I know what account to assign this person in the DragDrop method?
>>>
>>>-Ed
>
>Ed
>
>Do I need to check for this condidtion?
> >mouse click at nYCoord+20,nXCoord pixels
>I am haveing no luck. If I select an item in list 2, Wait window yields the selected account number no matter where I try to drop the item. If I don't select anything in list 2, Wait window yields nothing.
>
>Here is what I have:
>***********************
>Source - MouseDown Event
>
>thisform.mousex = nXCoord
>thisform.mousey = nYCoord
>
>********************
>Source: MouseMove Event
>
>IF nButton = 1 && Left Mouse
> IF ABS(nXCoord - THIS.PARENT.MouseX) > ;
> THIS.Parent.DragThreshold OR ;
> ABS(nYCoord - THIS.PARENT.MouseY) > ;
> THIS.Parent.DragThreshold
> thisform.mailbox = this.List(this.ListItemId)
> THIS.Drag
> ENDIF
>ENDIF
>
>*************
>SOURCE and Target: DragOver Event
>
>DO CASE
> CASE nState = 0 && Enter
> this.DragIcon = THIS.Parent.CanDropIcon
> CASE nState = 1 && Leave
> this.DragIcon = THIS.Parent.NoDropIcon
>ENDCASE
>
>**************
>Target: DragDrop Event
>
>thisform.tmr1.Enabled = .T.
>
>**********
>
>-Ed
>thisform.tmr1 Timer Event
>
>WAIT WINDOW thisform.lst1.Value NOWAIT
>this.Enabled = .F.

Sorry, I cannot understand your reply. Actually I gave you two events, where List1.DragDrop 1. imitates mouse click on List1 Item right under 'dropped item'.
and 2. launch timer to get List1.Value (it's necessary, because Value is not available in the same snippet).
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform