Results 1 to 2 of 2

Thread: How to know what kind of drag mode is being used

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    How to know what kind of drag mode is being used

    how do i know if the info being dragged is a picture or text...the place from where the picture is being dragged is a web browser controll...i am using .NET too

  2. #2
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878
    I don't know about .NET, but this info was useful to me in VB 6.


    The data that has been packaged by the dragged from application, is available to the dropped on application, although it must be decoded first. For example, to identify a list of files from Windows Explorer use the following:
    VB Code:
    1. If Data.GetFormat(15) Then
    2. 'Format 15 is an array of names from WinExplorer
    3.         MsgBox Data.Files(1)
    4.         For i = 2 To Data.Files.Count
    5.           MsgBox Data.Files(i)
    6.         Next i
    7.         Data.Files.Clear
    8.     End If
    The Format numbers used in the OLE DragDrop data structure, are:
    Text = 1 (vbCFText)
    Bitmap = 2 (vbCFBitmap)
    Metafile = 3
    Emetafile = 14
    DIB = 8
    Palette = 9
    Files = 15 (vbCFFiles)
    RTF = -16639

    If you want to drop files from your application back to Windows Explorer, the following will load the correct data structure with the file names (full names plus path are needed). Remember: Dropping these filenames onto Windows Explorer will initiate a copy operation.
    VB Code:
    1. Data.Files.Add "C:\Temp\Myfile1.TXT", 1
    2. Data.Files.Add "C:\Temp\Yourfile2.TXT", 2
    3. Data.SetData , 15

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