[求助]怎么我的按钮要按2下才能显示图片啊?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myfile As String
With Me.OpenFileDialog1
.Title = "打开图片文件"
.Filter = "图形文件(*.jpg)|*.jpg|位图文件(*.bmp)|*.bmp|所有文件(*.*)|*.*"
myfile = .FileName
.ShowDialog()
End With
On Error Resume Next (去了这一行程序不能运行,为什么啊)
If myfile.Length > 0 Then
Me.PictureBox1.Image = Image.FromFile(myfile, False)
End If
End Sub
End Class