CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Drag and drop

  1. #1
    Join Date
    Sep 2001
    Location
    South Africa
    Posts
    186

    Drag and drop

    Hi All

    I've got textboxes on the form in the shape of a family tree. How do I get drag and drop to work in the following manner: I want to select the text in one of the textboxes and drag it to another textbox where it must replace the text thats already in the textbox.

    I tried it but can only get the text to be dropped inserted in the textbox at the cursor position. The text in the drop textbox must be replaced with the text to be dropped.

    Thanx

    Bezzie

  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Drag and drop

    Set the OLEDropMode to manual then put this code into the OLEDragDrop event

    private Sub Text2_OLEDragDrop(Data as DataObject, Effect as Long, Button as Integer, Shift as Integer, X as Single, Y as Single)
    Dim temp as string
    temp = Text2.Text
    Text2.Text = Data.GetData(1)
    End Sub




    John G

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured