ofname.lpstrfiletitle = space(255) & chr(0)
ofname.nmaxfiletitle = 256
ofname.lpstrtitle = "选择图片..."
ofname.flags = ofn_longnames + ofn_pathmustexist + ofn_filemustexist + ofn_hidereadonly
if getopenfilename(ofname) then
screen.mousepointer = 11
doevents
savesetting "orientzixun", "background", "pathvalue", ofname.lpstrfile
frmback.setback
frmback.hide
screen.mousepointer = 0
end if
exit sub
errhandle:
screen.mousepointer = 0
msgbox err.description
end sub
option explicit
'背景子窗口代码
'/============================================================================\
'| 作者:崔占民 2003.6.21 |
'| email:cuizm@163.com |
'| 在窗口中分别添加一个picturebox控件和一个image控件,名称分别为:picback和 |
'| imgdefault |
'| |
'| |
'| |
'\============================================================================/
'设置背景函数
public sub setback()
on error resume next
dim i as long, j as long, ls_path as string
'从注册表中读取背景图片路径
ls_path = getsetting("orientzixun", "background", "pathvalue")
if trim(ls_path) <> "" then
if dir(ls_path) <> "" then
picback.picture = loadpicture(ls_path) '图片存在,将图片显示在缓冲区中
else
picback.picture = imgdefault.picture '图片不存在,用默认的图片
end if
else
picback.picture = imgdefault.picture '路径为空,用默认的图片
end if
if frmmain.mnupull.checked then '如果为拉伸