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()
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