把图片从网上下载后,把PICTURE的picture属性指向它就行了。

解决方案 »

  1.   

    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
    Public 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 Form_Load()
        Dim url As String
        url = "http://www.csdn.net/images/ad/dby2001_468_60.gif"
        Dim tmpFile As String
        tmpFile = "D:\temp\download.gif"
        
        
        DownloadFile url, tmpFile
        Set Picture1.Picture = LoadPicture(tmpFile)
        
    End Sub