Label遮盖了Button的问题[已解决]
本帖最后由 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# 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 谢谢,确实有效。
页:
[1]