タイトル : Re^3: Drag&DropでDrag元のショートカットのリンク先取得 投稿日 : 2008/01/18(Fri) 08:32 投稿者 : y4yama
横レスで失礼します > AllowDrop プロパティの設定はしています。 > また、DragDropのイベントでWshShortcutをどのように使ったら良いのでしょうか。 不要?のようです > 今回、DragDropをはじめて使うので分からない事だらけで、Googleでも色々検索したのですが・・・ F1のHelpでもTextについては出てきますよね Testだけですが、下記にて XP、VB2005ExpressEdition では動きました Vistaでは、どうでしょうか・・ Private Sub Button6_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Button6.DragDrop If e.Data.GetDataPresent(DataFormats.FileDrop) Then 'ドロップされたデータを取得 Dim itemObj As Object = e.Data.GetData(DataFormats.FileDrop) Console.WriteLine(" DragDroped:" & itemObj(0).ToString) End If End Sub Private Sub Button6_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Button6.DragEnter Console.WriteLine("fire Enter") '<<--Vistaで、これは出るでしょうか? Console.WriteLine("e.AllowedEffect=" & e.AllowedEffect) If e.Data.GetDataPresent(DataFormats.FileDrop) Then If (e.AllowedEffect And DragDropEffects.Copy) = _ DragDropEffects.Copy Then e.Effect = DragDropEffects.Copy Else e.Effect = DragDropEffects.None End If End If End Sub 電卓のアイコンをCtrlキーを押しながらButton6にDragします。ショートカット名 DragDroped:C:\Documents and Settings\xxxxxx1yama\デスクトップ\電卓.lnk と表示しました |