DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: draging and dropping on to a form??

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    draging and dropping on to a form??

    [Originally posted by dotnet]

    i have the following code, whihc alows me to drag files in to the picture box and they will be processed by the sub dragdrop, however i would rather they could drop the files on to any part of the form not just the box, so i changed picture1 to form 1 but it does not work, any idea why?? and how i can fix it??

    Private Sub Picture1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, Y As Single)
    ˙ ˙ On Error Resume Next˙ ˙
    ˙ ˙ Call dragdrop(Data.Files(1), 0)
    ˙ ˙ If Err.Number > 0 Then MsgBox Err.Description
    End Sub

  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:draging and dropping on to a form??

    [Originally posted by dotnet]

    the reason it did not work is because since u can only have 1 form in a form it is just identified as form, so their is no 1 after it, so the code should look like this:

    Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, x As Single, Y As Single)
    ˙ ˙ On Error Resume Next˙ ˙
    ˙ ˙ Call dragdrop(Data.Files(1), 0)
    ˙ ˙ If Err.Number > 0 Then MsgBox Err.Description
    End Sub

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:draging and dropping on to a form??

    [Originally posted by neophile]

    Yeah. You can tell by looking at the two combo's at the top of the code window. The first one is for objects and the second for procedures... When incorrect, that procedure would look like this...

    (General)˙ ˙ ˙ | Form1_OLEDragDrop()

    ...and when correct, like this...

    Form˙ ˙ ˙ ˙ ˙ ˙ | OLEDragDrop()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center