找回密码
 加入
搜索
查看: 2505|回复: 2

[AU3基础] Label遮盖了Button的问题[已解决]

[复制链接]
发表于 2010-9-13 10:49:22 | 显示全部楼层 |阅读模式
本帖最后由 wz4705 于 2010-9-13 19:03 编辑
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("窗体1", 413, 298, 302, 218)
$Label1 = GUICtrlCreateLabel("Label1", 0, 80, 412, 97)
GUICtrlSetBkColor(-1, 0x0054E3)
$Button1 = GUICtrlCreateButton("Button1", 152, 120, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

        EndSwitch
WEnd
Button1按钮是在Label1后面创建,但是只是显示按钮无法点击。
这个要怎么解决,Label1我是想做一个背景。

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-9-13 11:40:20 | 显示全部楼层
回复 1# wz4705

用GUICtrlSetState(-1, $GUI_DISABLE)可以,应该还有其他办法
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("窗体1", 413, 298, 302, 218)
$Label1 = GUICtrlCreateLabel("Label1", 0, 80, 412, 97)
GUICtrlSetBkColor(-1, 0x0054E3)
GUICtrlSetState(-1, $GUI_DISABLE)
$Button1 = GUICtrlCreateButton("Button1", 152, 120, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        MsgBox(0, 0, "我是按扭")
        EndSwitch

WEnd

评分

参与人数 2金钱 +30 收起 理由
wz4705 + 10 谢谢,确实有效。
afan + 20

查看全部评分

 楼主| 发表于 2010-9-13 19:03:15 | 显示全部楼层
谢谢,确实有效。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-17 17:04 , Processed in 0.084322 second(s), 29 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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