|
' ******************************************************
' ドラッグドロップ
' ******************************************************
Public Sub DragDropAction(frm As Form, x As Single, Source As Control, Target As Object)
Dim rc As RECT
Dim strPath As String
Dim strRet As String
GetClientRect frm.hwnd, rc
Select Case nDrag
Case DRAG_BAR
If Target.Name = "trvサーバ" Then
nWidthTreeView = x
Else
nWidthTreeView = frm.trvサーバ.Width + x
End If
With frm.trvサーバ
.Width = nWidthTreeView
.Height = frm.ScaleY(rc.Bottom, vbPixels, vbTwips)
End With
With frm.drgBar
.Left = frm.trvサーバ.Width
.Top = 0
.Height = frm.ScaleY(rc.Bottom, vbPixels, vbTwips)
End With
With frm.drvローカル
.Left = frm.trvサーバ.Width + frm.drgBar.Width
.Top = 0
.Width = frm.ScaleX(rc.Right, vbPixels, vbTwips) _
- nWidthTreeView _
- frm.drgBar.Width
End With
With frm.lstローカル
.Left = frm.trvサーバ.Width + frm.drgBar.Width
.Top = frm.drvローカル.Height
.Width = frm.Width - nWidthTreeView - frm.drgBar.Width
.Width = frm.ScaleX(rc.Right, vbPixels, vbTwips) _
- nWidthTreeView _
- frm.drgBar.Width
.Height = frm.ScaleY(rc.Bottom, vbPixels, vbTwips) _
- frm.drvローカル.Height
End With
Case DRAG_FTPFILE
Dim nodフォルダ As Node
Set nodフォルダ = frm.trvサーバ.SelectedItem
If Target.Name = "lstローカル" Then
strPath = frm.filローカル.Path & "\" & nodフォルダ.Text
If vbOK = MsgBox("ダウンロードを開始します。よろしいですか?", vbOKCancel) Then
strRet = Module1.lbFTPDownload("/" & nodフォルダ.FullPath, strPath)
If strRet <> "" Then
MsgBox (strRet)
Else
MsgBox ("ダウンロードが終了しました")
LoadListView frm
End If
End If
End If
End Select
End Sub
| |