Results 1 to 3 of 3

Thread: drag, drop, huh?

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    can somebody explain how to use the OLEDragDrop deal??
    Like If I want to select text from a textbox and then drag it onto a listbox and have the selected text be added to the listbox, how does I does that?
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    I Think this'll get ya started...
    put a listbox and a textbox on ya form and paste this code:

    Code:
    Private Sub List1_DragDrop(Source As Control, X As Single, Y As Single)
    If Source = Text1 Then List1.AddItem Text1 'Drop it.
    End Sub
    
    Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Text1.SelStart = 0 'this is optional, just to select the text in the textbox
    Text1.SelLength = Len((Text1)) 'this is optional, just to select the text in the textbox
    Text1.Drag vbBeginDrag 'Drag it.
    End Sub

    Hope it helps ya a bit
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  3. #3

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    cool, thanks
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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