行者靖 发表于 2009-6-29 23:28:49

LabeL控件和PIC控件叠放的问题。

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 449, 192, 124)
;$Pic1 = GUICtrlCreatePic("F:\AutoFile\about.jpg", 8, 8, 617, 393, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))


        $www = GUICtrlCreateLabel ("网址:www.autoitscript.com/forum/",59,190,140,15)
        GuiCtrlSetFont($www, 8.5, -1, 4) ; underlined
        GuiCtrlSetColor($www,0x0000ff)
        GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        GuiCtrlSetCursor($www,0)
        GUICtrlSetOnEvent(-1, "OnWWW")

GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

        EndSwitch
WEnd
Func OnWWW()
      Run(@ComSpec & " /c " & 'start http://www.autoitscript.com/forum/', "", @SW_HIDE)
EndFunc
        本来想做一个关于窗口,窗口设计为图片底图,LABEL空间在图片上面,文字有网址链接,可单击后跳转到主页。
      现在的问题是,如果LABEL控件放在图片上,就无法单击跳转到指定的主页。
   去掉图片控件 就可以使用;奇怪了。

请朋友帮帮忙看看。。谢谢。

jhun 发表于 2009-6-30 00:03:16

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 633, 449, 192, 124)







      $www = GUICtrlCreateLabel ("网址:www.autoitscript.com/forum/",59,190,140,15)

      GuiCtrlSetFont($www, 8.5, -1, 4) ; underlined

      GuiCtrlSetColor($www,0x0000ff)

      GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

      GuiCtrlSetCursor($www,0)

      GUICtrlSetOnEvent(-1, "OnWWW")
$Pic1 = GUICtrlCreatePic("F:\AutoFile\about.jpg", 8, 8, 617, 393, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))


GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###



While 1

      $nMsg = GUIGetMsg()

      Switch $nMsg

                Case $GUI_EVENT_CLOSE

                        Exit



      EndSwitch

WEnd

Func OnWWW()

      Run(@ComSpec & " /c " & 'start http://www.autoitscript.com/forum/', "", @SW_HIDE)

EndFunc

行者靖 发表于 2009-6-30 09:06:55

太感谢 jhun帮忙了。 这个问题已经解决了。

不过出了个新的问题, 将图片控件移动到下面,原来标签的背景透明效果就没有了。现在标签都有背景色了。

还请在此指教。。谢谢了。。。

jhun 发表于 2009-6-30 13:11:57

这个就不好办了,你看能否找到合适的图片,就是文字区域下面是纯色的,然后把标签的背景色设置成图片一样的颜色

行者靖 发表于 2009-6-30 14:17:40

呵呵。目前看来也只能这样了。 谢谢你。。。
页: [1]
查看完整版本: LabeL控件和PIC控件叠放的问题。