Public Class Form1 Private Sub TextBox1_DragDrop(ByVal sender As System.Object,ByVal e As System.windows.Forms.DragEventArgs) Handles TextBox1.DragDrop If e.Data.GetDataPresent(DataFormats.fileDrop) Then Dim Myfiles() As String Myfiles = CType(e.Data.GetData(DataFormats.fileDrop),String()) MsgBox(Myfiles(0)) End If End Sub Private Sub TextBox1_dragenter(ByVal sender As System.Object,ByVal e As System.windows.Forms.DragEventArgs) Handles TextBox1.dragenter If e.Data.GetDataPresent(DataFormats.fileDrop) Then e.Effect = DragDropEffects.All End If End Sub Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load TextBox1.AllowDrop = True End SubEnd Class总结
以上是内存溢出为你收集整理的VB2005文件拖放到控件上全部内容,希望文章能够帮你解决VB2005文件拖放到控件上所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)