Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE Drag and drop icon change

Status
Not open for further replies.

fenris

Programmer
May 20, 1999
824
CA
Below is the code that I am using to collect files from explorer in a multiple drag and drop operation to a text box located on my VB form.

It works great, but I can't get the icon (draging icon) to change to a custom (one that I created) icon when it hovers over the textbox. I have tried the OLEDragOver event, but it doesn't seem to work.

Does anybody have a simple working example or pointers?

I know this is probably really simple....


Thanks...



'========================================
Private Sub txtFiles_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim i As Long, upper As Long

upper = Data.Files.Count

For i = 1 To upper
'check if the dragged object(s) is a file or directory
If (GetAttr(Data.Files(i))) = vbDirectory Then
MsgBox "Directories cannot be dropped into the editor", vbCritical + vbOKOnly, "Opps..."

Else
'if the the object is not a directory then see if it
'is a valid file.
If Data.GetFormat(vbCFFiles) Then
txtFiles.Text = txtFiles.Text & Data.Files.Item(i) & vbNewLine
End If
End If
Next 'i

Data.Files.Clear 'clear it out for the next run
End Sub
'======================================== Troy Williams B.Eng.
fenris@hotmail.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top