字符串写进去了Input不显示刚输入的字符串,求大侠处理哈(已解决)
本帖最后由 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
#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
你自己看下是不是这个意思 回复 2# cfanpc
不是你这个意思,我想表达的是继续在Input编辑框输入字符串,字符串向左移动,显示刚输入的字符串(这是我用键盘输入),如果点击$butmc1按钮写入字符串的话就没有这种效果
回复 3# qsy666888
可以显示啊。
运行版本 AU3Check (3.3.14.2) 回复 4# chzj589
没有上面那种效果,看嘛
这种操作真是少见……
GUICtrlSetData($Input1, ... 之后下面加一行
GUICtrlSetState($Input1, Send('{RIGHT}') + 256) 回复 6# afan
谢谢版主 高大上的东西
页:
[1]