Microsoft KB Archive/137435

= How To Drag and Drop from a Grid to a Text Box =

Article ID: 137435

Article Last Modified on 6/30/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q137435



SUMMARY
This article shows by example how to drag text from a cell in a grid to a text box on a form.



Step-by-Step Example
 Create a form called Dragndrop. Add the Customer table located in \Samples\Data to the environment. Place a grid on the form. Change the ColumnCount to 3.  In the Properties window, select the Text1 object located in the column of the grid. Place the following code in the MouseDown event of each [form1|Grid1|Column] Text1 object. This.Drag(1)   Add a text box to the form. Place the following line of code in the DragDrop event of the text box: This.Value = oSource.Value NOTE: oSource is a parameter defined in a DragDrop event of an object. It is use in a DragDrop event as a reference to the control being. dragged You can refer to properties and methods of the control being dragged by using this oSource parameter.  Run the form. Click any cell in the grid to select the field, and hold the mouse button down. Drag the mouse pointer to the text field, and release the mouse button to copy the contents of the grid cell into the text box.</li></ol>

Keywords: kbhowto kbdesigner kbcode KB137435

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.