为何下面的编辑框没办法切换自动换行或不自动换呢?#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <guiedit.au3>
#include <string.au3>
$Form1 = GUICreate("", 190, 240)
$Edit1 = _GUICtrlEdit_Create($Form1,"", 0, 0, 190, 190)
$Button1 = GUICtrlCreateButton("显示", 10, 200, 150, 30)
GUISetState(@SW_SHOW)
local $flag=0
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
if $flag then
$flag=1
else
$flag=0
endif
_setautoline($Edit1,$flag)
EndSwitch
WEnd
Func _SetAutoLine($hEdit,$flag=0)
if $flag=0 then;不自动换行
guictrlsetstyle($hEdit,bitor($ES_MULTILINE, $ES_WANTRETURN))
else;自动换行
guictrlsetstyle($hEdit,bitor($ES_MULTILINE, $ES_WANTRETURN, $WS_VSCROLL, $WS_HSCROLL, $ES_AUTOVSCROLL, $ES_AUTOHSCROLL))
endif
EndFunc;setautoline
|