在WINAMP中可以从资源管理器把要播放的歌曲拖入播放列表,有谁知道怎么用VB编程实现这样的功能请把下面的保存为Form1.frmVERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  'Windows Default
   Begin VB.ListBox List1 
      Height          =   1320
      ItemData        =   "Form1.frx":0000
      Left            =   120
      List            =   "Form1.frx":0007
      OLEDropMode     =   1  'Manual
      TabIndex        =   0
      Top             =   1065
      Width           =   4365
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "请把文件拖到下面的列表框中释放"
      Height          =   180
      Left            =   105
      TabIndex        =   1
      Top             =   720
      Width           =   2700
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = FalsePrivate Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Data.GetFormat(vbCFFiles) = True Then
            List1.AddItem Data.Files.Item(1)
    End If
End Sub

解决方案 »

  1.   

    OLEDropMode          =      1    'Manual'不知道是这个意思吗?
      

  2.   

    '0、建立一个 工程
    '1、在Form上加个List1
    '2、设置 List1 的 OLEDropMode = 1 'Manual
    '3、把下面的代码贴到 代码 里面
    Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Data.GetFormat(vbCFFiles) = True Then
            List1.AddItem Data.Files.Item(1)
        End If
    End Sub
    '4、按 F5
    '5、请把文件拖到列表框 List1 中释放
    '6、在VB5.0+WinSe VB6.0+WinSe  通过
      

  3.   

    建议把List1.AddItem  Data.Files.Item(1)行改成For i = 1 To Data.Files.Count
      List1.AddItem Data.Files.Item(i)
    Next i
    以便可实现拖动多个文件。