#include <GuiRichEdit.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("输入/选择焦点切换", 300, 240)
$hRichEdit1 = _GUICtrlRichEdit_Create($Form1, "", 8, 16, 273, 145, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_READONLY, $ES_AUTOVSCROLL))
_GUICtrlRichEdit_AppendText($hRichEdit1, @CR & "This is appended text.")
_GUICtrlRichEdit_AutoDetectURL($hRichEdit1, True)
_GUICtrlRichEdit_AppendText($hRichEdit1, @CR & "http://www.autoitscript.com")
$Input1 = GUICtrlCreateInput("", 8, 168, 273, 21)
$Button1 = GUICtrlCreateButton("富文本", 8, 200, 81, 25)
$Button2 = GUICtrlCreateButton("Input框", 96, 200, 89, 25)
$Button3 = GUICtrlCreateButton("退出", 192, 200, 89, 25)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
GUIDelete();一定要加上否则退出后进程都还在
Exit
Case $Button1
ControlFocus("输入/选择焦点切换", "", 'RICHEDIT50W1')
Case $Button2
GUICtrlSetState($Input1, $GUI_FOCUS)
Case $Button3
GUIDelete();一定要加上否则退出后进程都还在
Exit
EndSwitch
WEnd
副文本,,创建按钮,点击就可以调用程序。。请高手赐教! |