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 Sub Form_Load()
' Download the file.
URLDownloadToFile 0, _
"http://www.vb-helper.com/vbhelper_425_64.gif", _
"C:\vbhelper_425_64.gif", 0, 0
' Display the image.
picBanner.Picture = _
LoadPicture("C:\vbhelper_425_64.gif")
' Size to fit.
Me.Width = picBanner.Width + 2 * picBanner.Left + _
(Me.Width - Me.ScaleWidth)
Me.Height = picBanner.Height + 2 * picBanner.Left + _
(Me.Height - Me.ScaleHeight)
End Sub
|