Private Sub Form_Load() Image1.Picture = LoadPicture(App.Path & "\test.jpg") End SubPrivate Sub Image1_DblClick() Image1.Picture = LoadPicture(App.Path & "\test.bmp") End Sub
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPrivate Sub Image1_DblClick() ' strUrl = "www.google.com" '打开指定的网页 strUrl = "c:\test.xls" '打开指定的文件 ShellExecute Me.hwnd, "Open", strUrl, "", "", 1 End Sub
Image1.Picture = LoadPicture(App.Path & "\test.jpg")
End SubPrivate Sub Image1_DblClick()
Image1.Picture = LoadPicture(App.Path & "\test.bmp")
End Sub
' strUrl = "www.google.com" '打开指定的网页
strUrl = "c:\test.xls" '打开指定的文件
ShellExecute Me.hwnd, "Open", strUrl, "", "", 1
End Sub