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
编译后在图片的打开方式中添加以你编译后的文件名
博客给出了一段VB代码,包含Form_Load和Form_Resize两个子程序。Form_Load用于加载图片,处理命令字符串并尝试加载图片,若出错则显示错误信息;Form_Resize用于调整图片显示。编译后可在图片打开方式中添加编译后的文件名。
1212

被折叠的 条评论
为什么被折叠?



