投机取巧+没有考虑中文的情况 自己处理下
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <string.au3>
$Form1 = GUICreate("", 190, 240)
$Edit1 = GUICtrlCreateEdit("", 0, 0, 190, 190, $ES_WANTRETURN)
$Button1 = GUICtrlCreateButton("显示", 10, 200, 150, 30)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$a = GUICtrlRead($Edit1)
$b = StringLen($a)
For $i = 1 To Round($b / 30)
If $i = 1 Then
$a = _StringInsert($a, @CR, $i * 30)
Else
$a = _StringInsert($a, @CR, $i * 30 + ($i - 1))
EndIf
Next
MsgBox(0, "", $a)
EndSwitch
WEnd
|