平铺与拉伸MDI窗口的背景图 ~!~[2]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 cuizm 的 blog

    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 '如果为拉伸

本文关键:MDI,背景图,平铺,拉伸
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top