标题:[求助]怎么我的按钮要按2下才能显示图片啊?
只看楼主
zh286091487
Rank: 1
等 级:新手上路
帖 子:36
专家分:0
注 册:2007-3-22
 问题点数:0 回复次数:0 
[求助]怎么我的按钮要按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

搜索更多相关主题的帖子: 按钮 
2007-04-06 15:33



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-129759-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.088642 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved