这道例子和百例79相类似,同样用到了CommonDialog控件
http://baike.baidu.com/view/2420618.htm
Option Explicit
Private Sub Command1_Click()
cdl1.Filter = "图片文件(*.bmp;*.jpg;*.tif)/*.bmp;*.jpg;*.tif"
cdl1.ShowOpen '显示图片
img1.Picture = LoadPicture(cdl1.FileName) '在图像框中显示打开的图片 红色的字体是这道例子的关键所在
End Sub
Private Sub Command2_Click()
img1.Picture = LoadPicture() '清除图相框中的图片
End Sub
Private Sub Command3_Click()
End
End Sub
成品图 原文链接:https://www.f2er.com/vb/260351.html