#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 313, 271, 198, 125, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN))
$Edit1 = GUICtrlCreateEdit("", 16, 24, 273, 81)
GUICtrlSetData(-1, "")
$oRP = ObjCreate("RICHTEXT.RichtextCtrl.1")
$GUIActiveX = GUICtrlCreateObj($oRP, 16, 144, 273, 97)
GUICtrlSetPos($GUIActiveX, 16, 144, 273, 97)
With $oRP; Object tag pool
.OLEDrag()
.Font = 'Arial'
.text = ""
;.FileName = @ScriptDir & '\RichText.rtf'
;.BackColor = 0xff00
EndWith
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Edit1
_copy()
EndSwitch
WEnd
Func _copy()
$oRP.text = GUICtrlRead($Edit1)
EndFunc
在Edit1框中输入字符,点击$GUIActiveX 窗口字符正常复制.而$Edit1 = GUICtrlRead($oRP.text),在$GUIActiveX中输入字符去不能被正常复制到框中,这是为何?
还有怎么实现在Edit1框中输入字符,立即在GUIActiveX框中显示出来,不需要点击鼠标. |