找回密码
 加入
搜索
查看: 1699|回复: 7

[AU3基础] 字符串写进去了Input不显示刚输入的字符串,求大侠处理哈(已解决)

  [复制链接]
发表于 2018-3-6 17:45:41 | 显示全部楼层 |阅读模式
本帖最后由 qsy666888 于 2018-3-6 23:15 编辑

字符串写进去了Input不显示刚输入的字符串,一直停在前面的字符串上
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 180, 140, 192, 124)
$Input1 = GUICtrlCreateInput(""&@CRLF&'', 16, 24, 150, 30,$ES_MULTILINE + 0x80)
$butmc1 = GUICtrlCreateButton("abcd", 30, 70, 55, 25)
$butmc2 = GUICtrlCreateButton("efjhi", 90, 70, 55, 25)
$hangtext1= ''
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        Case $butmc1                        
                    $hangtext1 = ControlCommand( "Form1", "", $Input1,"GetLine", 2)
                        GUICtrlSetData($Input1,''&@CRLF&$hangtext1&"abcdefghijklmn")
                Case $butmc2                
                    $hangtext1 = ControlCommand( "Form1", "", $Input1,"GetLine", 2)
                        GUICtrlSetData($Input1,''&@CRLF&$hangtext1&"123+++456")
        EndSwitch
WEnd

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2018-3-6 19:41:10 | 显示全部楼层
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 180, 140, 192, 124)
$Input1 = GUICtrlCreateEdit("" & @CRLF & '', 16, 24, 150, 30, $ES_MULTILINE + 0x80)
$butmc1 = GUICtrlCreateButton("写入1", 30, 70, 55, 25)
$butmc2 = GUICtrlCreateButton("写入2", 90, 70, 55, 25)
$butmc3 = GUICtrlCreateButton("读取", 90, 100, 55, 25)
$hangtext1 = ''
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $butmc1
                        $hangtext1 = ControlCommand("Form1", "", $Input1, "GetLine", 2)
                        GUICtrlSetData($Input1, '' & @CRLF & "abcdefghijklmn")
                Case $butmc2
                        $hangtext1 = ControlCommand("Form1", "", $Input1, "GetLine", 2)
                        GUICtrlSetData($Input1, '' & @CRLF & "123+++456")
                Case $butmc3
                        MsgBox(Default, Default, GUICtrlRead($Input1))
        EndSwitch
WEnd
你自己看下是不是这个意思
 楼主| 发表于 2018-3-6 20:36:45 | 显示全部楼层
回复 2# cfanpc

不是你这个意思,我想表达的是继续在Input编辑框输入字符串,字符串向左移动,显示刚输入的字符串(这是我用键盘输入),如果点击$butmc1按钮写入字符串的话就没有这种效果

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2018-3-6 20:52:43 | 显示全部楼层
回复 3# qsy666888
可以显示啊。
运行版本 AU3Check (3.3.14.2)
 楼主| 发表于 2018-3-6 20:57:26 | 显示全部楼层
回复 4# chzj589

没有上面那种效果,看嘛

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2018-3-6 21:13:47 | 显示全部楼层
这种操作真是少见……
GUICtrlSetData($Input1, ... 之后下面加一行
GUICtrlSetState($Input1, Send('{RIGHT}') + 256)
 楼主| 发表于 2018-3-6 23:13:52 | 显示全部楼层
回复 6# afan

谢谢版主
发表于 2018-3-8 20:45:15 | 显示全部楼层
高大上的东西
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-28 09:32 , Processed in 0.156189 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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