陌上风 发表于 2008-7-3 10:33:25

Group 控件透明问题

        $Group1 = GUICtrlCreateGroup("Windows 游戏",10,220, 102, 98)
                GUICtrlSetColor(-1, 0x0000FF)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        $label1 = GUICtrlCreateLabel ("F1" & $name1 ,20,240)
                GUICtrlSetColor(-1, 0xFF0000)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        $label2 = GUICtrlCreateLabel ("F2" & $name2 ,20,260)
                GUICtrlSetColor(-1, 0xFF0000)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        $label3 = GUICtrlCreateLabel ("F3" & $name3 ,20,280)
                GUICtrlSetColor(-1, 0xFF0000)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        $label4 = GUICtrlCreateLabel ("F4" & $name4 ,20,300)
                GUICtrlSetColor(-1, 0xFF0000)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

为何 Group 名 Windows 游戏 不能实现透明?
http://bbs.finebbs.com/attachment/Mon_0807/001.jpg

[ 本帖最后由 陌上风 于 2008-7-4 15:32 编辑 ]

陌上风 发表于 2008-7-3 19:39:01

自己顶上去!

顽固不化 发表于 2008-7-3 19:54:51

没看到完整码,不好测试。

陌上风 发表于 2008-7-3 20:18:51

完整代码:
#NoTrayIcon
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

If FileExists(@HomeDrive&"\back.jpg") Then
        $Backpic=@HomeDrive&"\back.jpg"
Else
        $Backpic=@WindowsDir&"\abc.jpg"
EndIf

GUICreate("", @DesktopWidth, @DesktopHeight, "", "", $WS_POPUP)
GUICtrlCreatePic($Backpic,0,0,@DesktopWidth,@DesktopHeight,BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))

GUISetState(@SW_SHOW)

;读取游戏配置文件
$name1 = IniRead(@WindowsDir&"\set.ini","game","name1","")
$name2 = IniRead(@WindowsDir&"\set.ini","game","name2","")
$name3 = IniRead(@WindowsDir&"\set.ini","game","name3","")
$name4 = IniRead(@WindowsDir&"\set.ini","game","name4","")
$name5 = IniRead(@WindowsDir&"\set.ini","game","name5","")
$game1 = IniRead(@WindowsDir&"\set.ini","game","game1","")
$game2 = IniRead(@WindowsDir&"\set.ini","game","game2","")
$game3 = IniRead(@WindowsDir&"\set.ini","game","game3","")
$game4 = IniRead(@WindowsDir&"\set.ini","game","game4","")
$game5 = IniRead(@WindowsDir&"\set.ini","game","game5","")

        $Group1 = GUICtrlCreateGroup("Windows 游戏",10,220, 102, 120)
                GUICtrlSetColor(-1, 0x0000FF)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        $label1 = GUICtrlCreateLabel ("F1" & $name1 ,20,240)
                GUICtrlSetColor(-1, 0xFF0000)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        $label2 = GUICtrlCreateLabel ("F2" & $name2 ,20,260)
                GUICtrlSetColor(-1, 0xFF0000)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        $label3 = GUICtrlCreateLabel ("F3" & $name3 ,20,280)
                GUICtrlSetColor(-1, 0xFF0000)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        $label4 = GUICtrlCreateLabel ("F4" & $name4 ,20,300)
                GUICtrlSetColor(-1, 0xFF0000)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
        $label5 = GUICtrlCreateLabel ("F5" & $name5 ,20,320)
                GUICtrlSetColor(-1, 0xFF0000)
                GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)

HotKeySet("{F1}","game1")
HotKeySet("{F2}","game2")
HotKeySet("{F3}","game3")
HotKeySet("{F4}","game4")
HotKeySet("{F5}","game5")

Sleep(10000)

Func game1()
        If $game1 = "" Then
                MsgBox(16,"出错", $name1 & "不存在")
        Else
                Run($game1)
        EndIf
EndFunc

Func game2()
        If $game2 = "" Then
                MsgBox(16,"出错","游戏不存在")
        Else
                Run($game2)
        EndIf
EndFunc

Func game3()
        If $game3 = "" Then
                MsgBox(16,"出错","游戏不存在")
        Else
                Run($game3)
        EndIf
EndFunc

Func game4()
        If $game4 = "" Then
                MsgBox(16,"出错","游戏不存在")
        Else
                Run($game4)
        EndIf
EndFunc

Func game5()
        If $game5 = "" Then
                MsgBox(16,"出错","游戏不存在")
        Else
                Run($game5)
        EndIf
EndFunc

配置文件(set.ini):

name1 = 扫雷
game1 = C:\Windows\system32\winmine.exe
name2 = 纸牌
game2 = C:\Windows\system32\sol.exe
name3 = 蜘珠纸牌
game3 = C:\Windows\system32\spider.exe
name4 = 空当接龙
game4 = C:\Windows\system32\freecell.exe
name5 = 红心大战
game5 = C:\Windows\system32\mshearts.exe

[ 本帖最后由 陌上风 于 2008-7-3 20:23 编辑 ]

顽固不化 发表于 2008-7-3 21:32:10

刚才测试了一下,透明的参数只对其内部区域起作用,对文字背景一点作用也没有。
可能这个控件还是有点bug的。

jsj731 发表于 2008-7-4 14:10:01

同意楼上.支持原创!!!!!1

316428696 发表于 2009-10-26 00:18:51

是WIN 控件的问题!
页: [1]
查看完整版本: Group 控件透明问题