本帖最后由 lynfr8 于 2009-6-18 00:44 编辑
GUICtrlSetState(-1, $GUI_DISABLE)对于IP地址控件无效的
IP地址控件只能 _GUICtrlIpAddress_ShowHide隐藏或者显示
换一个思路:
当你要将其变为“不可用”就隐藏IP控件显示替身label#Region ;**** 参数创建于 AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#Include <GuiIPAddress.au3>
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
Local $hgui,$my
$hgui = GUICreate("IP",340,370)
GUICtrlCreateLabel("IP 地址:",40,130)
$Edit_Ipaddress = _GUICtrlIpAddress_Create ($hgui, 150,125)
GUICtrlSetState($Edit_Ipaddress, $GUI_DISABLE)
GUISetState(@SW_SHOW)
_GUICtrlIpAddress_Set ($Edit_Ipaddress, "24.168.2.128")
Sleep(2000)
_GUICtrlIpAddress_ShowHide ($Edit_Ipaddress, @SW_HIDE)
$my= GUICtrlCreateLabel("24.168.2.128", 150, 128, 150, 125)
Sleep(1000)
GUICtrlDelete ($my)
_GUICtrlIpAddress_ShowHide ($Edit_Ipaddress, @SW_SHOW)
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
也将label可以换成四个edit并设置为$GUI_DISABLE用来显示ip
设置恰当的长度高度位置就可以以假乱真了。。 |