crazymarc
Mar 13th, 2001, 05:59 PM
How Can I Use A PictureBox Like This:
Picture1.Picture = "http://www.tha-nolia.com/image1.jpg"?
Why not just use a WebBrowser control?
WebBrowser1.Navigate "http://www.tha-nolia.com/image1.jpg"
crazymarc
Mar 13th, 2001, 10:43 PM
I Dont Want To Use The WebBrowser Control, I Want Some API Code.
Use the URLDownloadToFile API function.
Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long
Private Function DownloadFile(URL As String, _
LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Private Sub Command1_Click()
Dim DF As Boolean
DF = DownloadFile("http://www.tha-nolia.com/image1.jpg", "c:\image1.jpg")
If DF = True Then
Picture1.Picture = LoadPicture("c:\image1.jpg")
End If
End Sub