小巧工具--图片浏览器

徐鸿达
2023-12-01

Private Sub Form_Load()
On Error Resume Next
Dim a As String
a = Command
a = Replace(a, Chr(34), "")
Me.Picture2.Picture = LoadPicture(a)
If Err.Number <> 0 Then
MsgBox Err.Description
End If

End Sub

Private Sub Form_Resize()
On Error Resume Next
If Me.Height > 300 And Me.Width > 300 Then
Me.Picture1.ZOrder 0
Me.Picture1.Move 0, 0, Me.Width - 50, Me.Height - 50
If Not Picture2.Picture Is Nothing Then
Picture1.PaintPicture Me.Picture2.Picture, 0, 0, Me.Picture1.Width, Me.Picture1.Height, 0, 0, Me.Picture2.Width, Me.Picture2.Height
End If
End If
End Sub

编译后在图片的打开方式中添加以你编译后的文件名

 类似资料: