找回密码
 加入
搜索
查看: 3390|回复: 5

[GUI管理] TAB控件替换图片问题!(已解决)

  [复制链接]
发表于 2010-3-11 18:47:38 | 显示全部楼层 |阅读模式
本帖最后由 nmgwddj 于 2010-3-11 19:19 编辑

我想设置替换图片后刷新图片资源。。但是这样做的话 图片就不显示了。又没有什么好办法啊!
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 446, 377, 192, 114)
$Tab1 = GUICtrlCreateTab(16, 48, 409, 257)
GUICtrlCreateTabItem("数据1")
$Pic1 = GUICtrlCreatePic(@SystemDir & "\oemlogo.bmp", 88, 72, 249, 145)
$Button1 = GUICtrlCreateButton("替换", 152, 248, 121, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        bmp()

        EndSwitch
WEnd

Func bmp()
        FileCopy('d:\dj.bmp', 'c:\windows\system32\oemlogo.bmp', 1)
        MsgBox(0, '', '替换成功')
        GUICtrlDelete ($Pic1)
        $Pic1 = GUICtrlCreatePic("c:\windows\system32\oemlogo.bmp", 40, 80, 190, 120)
EndFunc

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-3-11 19:15:23 | 显示全部楼层
注释掉29行,30行改为:
GUICtrlSetImage($Pic1, @SystemDir & '\oemlogo.bmp')

评分

参与人数 1金钱 +20 贡献 +5 收起 理由
nmgwddj + 20 + 5 感谢。辛苦了

查看全部评分

 楼主| 发表于 2010-3-11 19:19:45 | 显示全部楼层
感谢afan
发表于 2010-3-24 20:35:01 | 显示全部楼层
非常不错的解决方法
发表于 2010-3-24 20:43:29 | 显示全部楼层
唉!!看不明白!再学学!!
发表于 2010-9-14 21:06:25 | 显示全部楼层
占个位,以后有用
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-6-9 06:11 , Processed in 0.100660 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表