输入内容保存后输入框为灰色【已解决】
本帖最后由 woeiwoei 于 2010-9-5 18:28 编辑如何 在输入框输入数字 并点保存按钮后 输入框为灰色而且显示输入的内容为灰色 并且不可再编辑。
点重置按钮后 清空内容。可以继续写入。 #include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 322, 99, 192, 124)
$Input1 = GUICtrlCreateInput("Input1", 16, 16, 289, 21)
$Button1 = GUICtrlCreateButton("保存", 64, 56, 75, 25)
$Button2 = GUICtrlCreateButton("重置", 168, 56, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_GUICtrlEdit_SetReadOnly($Input1, True)
Case $Button2
GUICtrlSetData($Input1,"")
_GUICtrlEdit_SetReadOnly($Input1, False)
EndSwitch
WEnd
这个也可以#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 322, 99, 192, 124)
$Input1 = GUICtrlCreateInput("Input1", 16, 16, 289, 21)
$Button1 = GUICtrlCreateButton("保存", 64, 56, 75, 25)
$Button2 = GUICtrlCreateButton("重置", 168, 56, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
GUICtrlSetState($Input1, $GUI_DISABLE)
Case $Button2
GUICtrlSetState($Input1, $GUI_ENABLE)
GUICtrlSetData($Input1,"")
EndSwitch
WEnd
回复 2# landays
请问怎么设代码高亮
{:face (461):} Msgbox(0,0,0)
把A去掉 {:face (239):}非常感谢两位~!! 回复 5# landays
谢谢{:face (468):}
页:
[1]