找回密码
 加入
搜索
查看: 3569|回复: 7

[GUI管理] GUI图片循环,点击图片问题

  [复制链接]
发表于 2010-11-9 15:30:19 | 显示全部楼层 |阅读模式
本帖最后由 qq82015930 于 2010-11-9 18:54 编辑

GUI图片循环,点击图片问题
如何让图片在GUI上循环且图片能点击,出现新的连接.
$Pic1 = GUICtrlCreatePic($jpg1, 0, 0, 470, 200)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1

        $Msg = GUIGetMsg()
        Select
        Case $msg = $GUI_EVENT_CLOSE
                        Exit
                Case $msg = $Pic1     ;点击图片访问网站
                            ShellExecute("http://www.cqluo.com")

                EndSelect
WEnd

Func _tc()
        FileDelete(@TempDir&"\01.jpg")
        Exit
EndFunc
这个是一张图片可以,我弄2张循环,可点击连接就失效拉。
发表于 2010-11-9 18:33:34 | 显示全部楼层
不理解是什么意思
发表于 2010-11-9 18:42:21 | 显示全部楼层
用图片控件循环更新图片地址就能显示吧,将图片点击事件设为打开链接,我想不难
 楼主| 发表于 2010-11-9 18:51:04 | 显示全部楼层
$Pic1 = GUICtrlCreatePic($jpg1, 0, 0, 470, 200)
GUICtrlSetCursor (-1, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1

        $Msg = GUIGetMsg()
        Select
        Case $msg = $GUI_EVENT_CLOSE
                        Exit
                Case $msg = $Pic1     ;点击图片访问网站
                            ShellExecute("http://www.cqluo.com")

                EndSelect
WEnd

Func _tc()
        FileDelete(@TempDir&"\01.jpg")
        Exit
EndFunc
这个是一张图片可以,我弄2张循环,可点击连接就失效拉。
发表于 2010-11-10 13:12:58 | 显示全部楼层
呵呵 不懂  学习下
发表于 2010-11-10 18:23:34 | 显示全部楼层
不懂等高手解答
发表于 2010-11-21 09:54:17 | 显示全部楼层
看不明白 留言學習一下QQ
发表于 2010-11-21 11:11:07 | 显示全部楼层
楼主可以用事件模式,这样图片即可以循环,也不影响点击了

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Opt("GUIOnEventMode", 1)

$Form1 = GUICreate("Form1", 250, 250, 192, 124)
        GUISetOnEvent($GUI_EVENT_CLOSE, "GUI")
$Pic = GUICtrlCreatePic("", 100, 100, 32, 32)
        GUICtrlSetOnEvent(-1, "GUI")
        GUICtrlSetCursor (-1, 0)
       
GUISetState(@SW_SHOW)

$Bmp1 = @ProgramFilesDir & "\AutoIt3\Examples\GUI\Advanced\Images\Blue.bmp"
$Bmp2 = @ProgramFilesDir & "\AutoIt3\Examples\GUI\Advanced\Images\red.bmp"

While 1
        GUICtrlSetImage($Pic, $Bmp2)
        Sleep(500)
        GUICtrlSetImage($Pic, $Bmp1)
        Sleep(500)
WEnd

Func GUI()
        Switch @GUI_CtrlId
        Case $GUI_EVENT_CLOSE
                Exit
        Case $Pic
                ShellExecute("http://www.cqluo.com")
        EndSwitch
EndFunc
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-21 01:15 , Processed in 0.079190 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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