VB6 Form内のDragDrop
VB6でForm内にCommandButtonがいくつか有ります。
各CommandButtonはClickするとShellオブジェクトでファイルを開く様になっています。
やりたいことは
2つのCommandButton間をDragDrop?によりCaptionを入れ替えたいです。
(CommandButton間をマウスDragDropでCaption名入れ替え)
MouseDownとDragDropイベントで何とかなると思いましたがうまくいきません。
Dim dd As Integer
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
dd = 1 'CommandボタンNo,
End If
End Sub
Private Sub Command2_DragDrop(Source As Control, X As Single, Y As Single)
Dim cn As String
cn = Command2.Caption
Command2.Caption = Controls("Command" & dd).Caption
Controls("Command" & dd).Caption = cn
End Sub
CommandButtonプロパティでDragModeを自動にするとShellオブジェクトでファイルが開かないし
サイトで調べたところファイルの移動やコマンド自体の移動などで分かりませんでした。
ご教授お願い致します。