I'm using the TaskPanel as a navigation menu for an MDI application - I allow users to also Drag/Drop items on the task panel to launch other applications. I've added the code to do the drag drop and it works for external programs to be dropped into the task panel but when I try to move items already in the taskpanel menu to a new location (drag up or drag down) the items vanish. The problem in part is due to the GetFormat because the items dragged don't have either format but I don't know that to check on- is there a different OLEDrag setting that I need to use for this type... is there a sample for this?
Private Sub wndToolBox_OLEDragDrop(ByVal Data As XtremeTaskPanel.DataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
Const MODULE_NAME = "wndToolBox_OLEDragDrop"
Dim Text As String
Dim Index As Long
Dim Ext As String
Dim icount As Integer
Dim iIndex As Integer
Dim Group As TaskPanelGroup
Dim fullpath As String
Dim tItem As TaskPanelGroupItem
If (Data.GetFormat(vbCFText)) Then
Effect = vbDropEffectCopy
Text = Data.GetData(vbCFText)
ElseIf Data.GetFormat(vbCFFiles) Then
Effect = vbDropEffectCopy
For Each file In Data.Files
fullpath = file
Ext = LCase(Right(file, 3))
' Remove the extension
Text = Left(file, Len(file) - 4)
Do
Index = InStr(Text, "\")
If Index <= 0 Then
Exit Do
End If
Text = Right(Text, Len(Text) - Index)
Loop
Set Group = frmMain.MainMenuPane.wndToolBox.FocusedItem.Group
CreateToolboxEXEItem Group, Text, fullpath
bSaveMenuINI = True
Next
Else
'Effect = vbDropEffectNone
End If
End Sub
Private Sub wndToolBox_OLEDragOver(ByVal Data As XtremeTaskPanel.DataObject, Effect As Long, ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single, ByVal state As Integer)
If (Data.GetFormat(vbCFText)) Then
Effect = vbDropEffectCopy
ElseIf Data.GetFormat(vbCFFiles) Then
Effect = vbDropEffectCopy
Else
' Effect = vbDropEffectNone
End If
End Sub
|