qq82015930 发表于 2010-11-9 15:30:19

GUI图片循环,点击图片问题

本帖最后由 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张循环,可点击连接就失效拉。

tryhi 发表于 2010-11-9 18:33:34

不理解是什么意思

xyold1 发表于 2010-11-9 18:42:21

用图片控件循环更新图片地址就能显示吧,将图片点击事件设为打开链接,我想不难

qq82015930 发表于 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张循环,可点击连接就失效拉。

G,man。 发表于 2010-11-10 13:12:58

呵呵 不懂学习下

btkingplay 发表于 2010-11-10 18:23:34

不懂等高手解答

michaellok001 发表于 2010-11-21 09:54:17

看不明白 留言學習一下QQ

yhxhappy 发表于 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
页: [1]
查看完整版本: GUI图片循环,点击图片问题