Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Draggin' and droppin' - getting started
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00032251
Message ID:
00032268
Views:
34
>Hi,
>My form has two textboxes,txtBoxA and txtBoxB. I would like to, at run time:
>1) Drag the data showing in txtBoxB and drop it on txtBoxA. What (which event) makes txtBoxB dragable?
>2) Which event in txtBoxA will accept the dropped data and update the value?
>2) Which event in txtBoxA can I put some code that will execute after the data is dropped there?
>
>Thanx! This is my first drag -n- drop programming task.
>John

I assume you want both text boxes to be editable and you want to be able to use drag-drop to copy text from one to the other. (If not, the interface could be improved over this.) Try this:

Text Box 1:

Edit double click method to say: THIS.Drag()

Text Box 2:

Edit DragDrop() method to read:

IF oSource.Name = "Text1" && or whatever your name is
THIS.Value = oSource.Value
THISFORM.Refresh
ENDIF

If Text1 were not editable, you could change its DragMode property to 1 (automatic) and then just a single click would start it dragging.

Go to property sheet, scroll to Drag, DragMode, DragDrop etc and hit F1 to check out discussion of these PEMs.

Randy
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform