MSMVPS.COM
The Ultimate Destination for Blogs by Current and Former Microsoft Most Valuable Professionals.

Drag & Drop of Internet Links from IE to a List Control

Using OLE Drag and Drop, this control enables you to drag and drop any link from Internet Explorer (IE) directly to a list control. You can even drag the icon from the IE address bar so that the current Web page's URL is inserted into the list control!

Here is sample list control that get the Internet link from Internet Explorer.

1.Start a new Visual Basic Standard EXE project. Form1 is created by default.

2.Add a ListBox (List1) to Form1.

3.Add the following code to the  Form1:
Private Sub Form_Load()
     'set the OLEDropMode property to Manual from default(None) 
      List1.OLEDropMode = 1

End Sub



Private Sub List1_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)

        Dim str As String
        str = Data.GetData(vbCFText)
        If Data.GetFormat(vbCFText) And UCase(Left(Data.GetData(vbCFText), 7)) = "HTTP://" Then _
        List1.AddItem Data.GetData(vbCFText)

End Sub

4.Start the program or press the F5 key,and try to drag a link from Internet Explorer to List1.


Posted Nov 10 2003, 01:06 PM by ch21st

Comments

ch21st wrote re: Drag & Drop of Internet Links from IE to a List Control
on 06-27-2004 11:50
ggg

Add a Comment

(required)  
(optional)
(required)  
Remember Me?


Copyright © is the original authors. Blog site is an independent site not sponsored by Microsoft. The Yoda blog server and the Brianna SQL server would like to thank www.ownwebnow.com and www.exchangedefender.com. They wouldn't be here and broadcasting without the generosity of Vlad Mazek and his companies.

Powered by Community Server (Commercial Edition), by Telligent Systems