找回密码
 加入
搜索
查看: 1889|回复: 6

Group 控件透明问题

[复制链接]
发表于 2008-7-3 10:33:25 | 显示全部楼层 |阅读模式
[au3]        $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)[/au3]

为何 Group 名 Windows 游戏 不能实现透明?


[ 本帖最后由 陌上风 于 2008-7-4 15:32 编辑 ]
 楼主| 发表于 2008-7-3 19:39:01 | 显示全部楼层
自己顶上去!
发表于 2008-7-3 19:54:51 | 显示全部楼层
没看到完整码,不好测试。
 楼主| 发表于 2008-7-3 20:18:51 | 显示全部楼层
完整代码:[au3]
#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[/au3]

配置文件(set.ini):
[game]
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的。
发表于 2008-7-4 14:10:01 | 显示全部楼层
同意楼上.支持原创!!!!!1
发表于 2009-10-26 00:18:51 | 显示全部楼层
是WIN 控件的问题!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-11-1 10:30 , Processed in 0.070895 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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