注册 登录
编程论坛 VB6论坛

请问控件数组怎么用OLEDragDrop拖放功能?(以加上源代码)

bccnbbs888 发布于 2019-04-05 17:57, 1395 次点击
程序上建立了好多个CommandButton控件数组怎么用OLEDragDrop拖放功能?
单个控件代码是这样就行
让文件夹拖放到程序Command1上获取该文件夹的路径
Private Sub Form_Load()
= 1
End Sub

Private Sub Command1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim nCount, nIndex As Integer
With Data
nCount = .Files.Count
For nIndex = 1 To nCount
strPath = strPath & .Files.Item(nIndex) & vbNewLine
Next
End With
Text1.Text = Trim(strPath)
End Sub
CommandButton是数组控件就出错了

[此贴子已经被作者于2019-4-5 23:27编辑过]

0 回复
1