IP控件不能禁用的问题[已解决]
本帖最后由 xsjtxy 于 2010-7-10 12:39 编辑;;;请教为什么_GUICtrlIpAddress_Create建的IP控件不能用GUICtrlSetState变成灰色!!
;;;;;谢谢2L的...先就用这办法了。希望下次版本更新的时候这个函数就能出这个功能的。哈哈!!
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiIPAddress.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 362, 205, -1, -1)
$IPAddress1 = _GUICtrlIpAddress_Create($Form1, 70, 32, 220, 21)
_GUICtrlIpAddress_Set($IPAddress1, "127.0.0.1")
$Input1 = GUICtrlCreateInput("为什么上面的IP控件不能像这个一样禁用?", 70, 104, 220, 21)
GUISetState(@SW_SHOW)
GUICtrlSetState($IPAddress1,$GUI_DISABLE)
GUICtrlSetState($Input1,$GUI_DISABLE)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd #include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiIPAddress.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 362, 205, -1, -1)
$IPAddress1 = _GUICtrlIpAddress_Create($Form1, 70, 32, 220, 21)
_GUICtrlIpAddress_Set($IPAddress1, "127.0.0.1")
$Input1 = GUICtrlCreateInput("为什么上面的IP控件不能像这个一样禁用?", 70, 104, 220, 21)
GUISetState(@SW_SHOW)
MsgBox(0,0,GUICtrlGetState ($IPAddress1));控件没有找到或未定义,将返回-1.
Sleep(1000)
_GUICtrlIpAddress_ShowHide ($IPAddress1, @SW_HIDE);也许只能用隐藏代替
Sleep(2000)
_GUICtrlIpAddress_ShowHide ($IPAddress1, @SW_SHOW)
;GUICtrlSetState($IPAddress1,$GUI_DISABLE)
;GUICtrlSetState($Input1,$GUI_DISABLE)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd 使用API函数可以使之变成禁用状态
页:
[1]