编辑框(edit)外部输入数据换行的问题
本帖最后由 levinfish 于 2014-3-29 22:49 编辑编了一个小的软件,需要从外部将数据读取到编辑框中,使用guictrlsetdata, 可以将数据输入编辑框,但是读入的数据全显示在一个段落里面,无法分行。
已经在GUICtrlSetData($edit,$array[$i],@CRLF)的参数中使用了换行标志,但是不起作用。
使用controlsend函数,可以实现换行,但是数据量大的话,执行程序,很长时间才能将数据显示出来。
使用GUICtrlSetData($edit,$array[$i]@CRLF,'a')可以实现,今天貌似很晕。
#include <EditConstants.au3>
#Include <GuiStatusBar.au3>
#include <GUIConstantsEx.au3>
#include <GUIConstantsEx.au3>
#include <file.au3>
#include <array.au3>
#include <WindowsConstants.au3>
#include <GuiTab.au3>
#include <date.au3>
Dim $array=['6','1','2','3','4','5']
Dim $edit
GuiDrawing()
Func GuiDrawing()
$guiparent=GUICreate("测试", 600, 600)
$edit=GUICtrlCreateEdit('',60,80,500,460,$ES_WANTRETURN + $WS_VSCROLL)
For $i=1 To 5
GUICtrlSetData($edit,$array[$i],@CRLF)
Next
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
EndFunc 刚才试了一下,使用ControlSend("测试",'' ,$edit,$array[$i]&@CR)可以实现
虽然可以实现换行,但是不知道二者为什么会有这个差异 For $i = 1 To 5
GUICtrlSetData($edit, $array[$i] & @CRLF, 1)
Next
页:
[1]