找回密码
 加入
搜索
查看: 1648|回复: 2

[AU3基础] IP控件不能禁用的问题[已解决]

[复制链接]
发表于 2010-7-10 11:10:41 | 显示全部楼层 |阅读模式
本帖最后由 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
发表于 2010-7-10 12:15:05 | 显示全部楼层
#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

评分

参与人数 2威望 +2 金钱 +20 收起 理由
xsjtxy + 20 感谢
afan + 2

查看全部评分

发表于 2010-11-6 14:53:56 | 显示全部楼层
使用API函数可以使之变成禁用状态
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-3 02:28 , Processed in 0.082279 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表