Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drag and Drop from Grid?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00094802
Message ID:
00094805
Vues:
23
>Has anyone worked out a way to drag and drop an item from a grid (or perhaps a list box) to another object (in this case another grid) so I can figure out which record it was dragged from? The grid row it is dragged TO is not important, in this case. I just wanna add items to a grid by dragging them from another grid (or something that looks and acts like that)?
>
>TIA
>
>Michael

Michael, it is not a big deal to DragDrop from Listbox since you know what is the current ListBox.Value, or DisplayValue

*Listbox.MouseMove
LPARAMETERS nButton, nShift, nXCoord, nYCoord
if nButton = 1
This.Drag()
endif

What about dragging from the grid, I actually drag not the textbox in the grid column, but invisible label on the form. Label has the proper DragIcon property.
 **** grid.column1.textbox1.MouseDown()
 LPARAMETERS nButton, nShift, nXCoord, nYCoord
 thisform.lblDrag.tag = anyValueIwantToCarry && Record ID, field value or specific code or whatever
 NODEFAULT

 **** grid.column1.textbox1.MouseMove()
 LPARAMETERS nButton, nShift, nXCoord, nYCoord
 NODEFAULT

 **** grid.MouseMove()
 LPARAMETERS nButton, nShift, nXCoord, nYCoord
 IF nButton = 1 
 *next two lines are to move label in proper position to start Drag from
                 Thisform.lblDrag.Left = nXCoord 
                 Thisform.lblDrag.Top = nYCoord
                 Thisform.lblDrag.Drag()
 ENDIF
HTH,

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform