找回密码
 加入
搜索
查看: 2186|回复: 9

输入框的读取和同步,求教!

  [复制链接]
发表于 2009-10-13 17:18:34 | 显示全部楼层 |阅读模式
本帖最后由 xlan 于 2009-10-14 22:33 编辑

想实现的功能是,在Input1中输入文字,Input2可以同步。
下面是个例子。。 例如:在Input1中输入“小胖”,Input2中能自动显示“他是小胖”

感谢,在线等解答!
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
Dim $xp = "他是"
$Form1 = GUICreate("Form1", 282, 178, 193, 115)
$Input1 = GUICtrlCreateInput("", 32, 24, 65, 21)
$Input2 = GUICtrlCreateInput($xp, 32, 64, 65, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
WEnd
发表于 2009-10-13 17:37:25 | 显示全部楼层
我不会这个,随便写个,基本满足要求
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
Dim $xp = "他是"
$Form1 = GUICreate("Form1", 282, 178, 193, 115)
$Input1 = GUICtrlCreateInput("", 32, 24, 100, 21)
$Input2 = GUICtrlCreateInput($xp, 32, 64, 100, 21,$es_readonly)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                EndSwitch
                $1 = GUICtrlRead($Input1)
                $2 = $xp
                $2 &= $1
                GUICtrlSetData($Input2,$2)
WEnd

评分

参与人数 1金钱 +5 收起 理由
xlan + 5 非常感谢!小弟钱不多,了表谢意!

查看全部评分

发表于 2009-10-13 17:38:11 | 显示全部楼层

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
Dim $xp = "他是"
$Form1 = GUICreate("Form1", 282, 178, 193, 115)
$Input1 = GUICtrlCreateInput("", 32, 24, 65, 21)
$Input2 = GUICtrlCreateInput("", 32, 64, 65, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit

        EndSwitch
        GUICtrlSetData($Input2,$xp&GUICtrlRead($Input1))
WEnd

评分

参与人数 1金钱 +5 收起 理由
xlan + 5 非常感谢!小弟钱不多,了表谢意!

查看全部评分

发表于 2009-10-13 17:38:47 | 显示全部楼层
哇,楼上的更厉害

这就是高手和菜鸟的区别,人家一行,菜鸟多行
发表于 2009-10-13 19:18:17 | 显示全部楼层
汗 殊途同归 你就别挖苦我了
发表于 2009-10-13 19:20:06 | 显示全部楼层
你们两都很厉害,过于谦虚等于骄傲,呵呵!
发表于 2010-2-5 01:47:19 | 显示全部楼层
占楼收藏。
发表于 2010-2-6 16:26:28 | 显示全部楼层
呵呵 学习啦 这个有用
发表于 2010-2-6 16:58:27 | 显示全部楼层
学习...
楼上很多强人
发表于 2011-3-4 19:51:01 | 显示全部楼层
收藏学习了。。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-10-2 12:37 , Processed in 0.076573 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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