标题:请问控件数组怎么用OLEDragDrop拖放功能?(以加上源代码)
取消只看楼主
bccnbbs888
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2019-4-5
 问题点数:0 回复次数:0 
请问控件数组怎么用OLEDragDrop拖放功能?(以加上源代码)
程序上建立了好多个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编辑过]

搜索更多相关主题的帖子: 控件 数组 拖放 Sub Integer 
2019-04-05 17:57



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-493973-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.132114 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved