这是代码,应该是一模一样的,或者你复制一下试试~附上截图,左边是窗体设计图,右边是执行效果图。再确认一下,点击启动后程序是不是能运行了?运行后,点击button是不是弹出对话框了?这个时候你只要选中你电脑上的一张图片,点“打开”就在你窗体上导入图片了~
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.ShowDialog()
PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
PictureBox1.Image = Nothing
End Sub
End Class