找回密码
 加入
搜索
查看: 3164|回复: 6

[AU3基础] 输入内容保存后输入框为灰色【已解决】

  [复制链接]
发表于 2010-9-5 18:03:05 | 显示全部楼层 |阅读模式
本帖最后由 woeiwoei 于 2010-9-5 18:28 编辑

如何 在输入框输入数字 并点保存按钮后 输入框为灰色而且显示输入的内容为灰色 并且不可再编辑。
点重置按钮后 清空内容。可以继续写入。

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-9-5 18:08:41 | 显示全部楼层
#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

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-9-5 18:22:59 | 显示全部楼层
这个也可以
#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

评分

参与人数 1金钱 +20 收起 理由
afan + 20

查看全部评分

发表于 2010-9-5 18:25:21 | 显示全部楼层
回复 2# landays

请问怎么设代码高亮

发表于 2010-9-5 18:26:13 | 显示全部楼层
[au3]Msgbox(0,0,0)[/au3A]
把A去掉
 楼主| 发表于 2010-9-5 18:28:23 | 显示全部楼层
非常感谢两位~!!
发表于 2010-9-5 18:31:14 | 显示全部楼层
回复 5# landays

谢谢
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-4 09:11 , Processed in 0.083770 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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