不大明白你的意思.想要完美的话,拦截WM_DRAWITEM消息自绘按钮吧.
如果想要简单的实现的话,试下以下内容.
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
$Form1_1 = GUICreate("Tool box", 261, 454, 386, 203)
$Button7 = GUICtrlCreateButton("Device infomation", 16, 304, 225, 33,0x8000)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button7
;GUICtrlSetBkColor($Button7, 0xAAAAAA)
$Button_temp=GUICtrlCreateButton("Device infomation", 16, 304, 225, 33)
GUICtrlSetState($Button7,$GUI_HIDE)
GUICtrlSetBkColor(-1,0xAAAAAA)
MsgBox(0,0,"点击确定变回原样")
GUICtrlDelete($Button_temp)
GUICtrlSetState($Button7,$GUI_SHOW)
;GUICtrlSetBkColor($Button7, 0xF0F0F0);这里该怎么写变回原来的?
EndSwitch
WEnd
|