- Offizieller Beitrag
Hallo!
so ich hab jetzt ein rtf control! alles schön und gut mit bunten farben usw.. ich will jetzt aber eine vertikale scrollbar haben! wie geht das in einem RTf control?
bisheriges script(autoit beta hilfe bei GuiCtrlcreateEdit!):
Code
#include <GUIConstants.au3>
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")
$oRP = ObjCreate("RICHTEXT.RichtextCtrl.1")
GUICreate("Embedded RICHTEXT control Test", 320, 200, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS))
$TagsPageC = GuiCtrlCreateLabel('Visit Tags Page', 5, 180, 100, 15, $SS_CENTER)
GuiCtrlSetFont($TagsPageC,9,400,4)
GuiCtrlSetColor($TagsPageC,0x0000ff)
GuiCtrlSetCursor($TagsPageC,0)
$AboutC = GUICtrlCreateButton('About',105,177,70,20)
$PrefsC = GUICtrlCreateButton('FontSize',175,177,70,20)
$StatC = GUICtrlCreateButton('Plain Style',245,177,70,20)
$GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 400 , 260 )
GUICtrlSetPos($GUIActiveX,10,10,300,160)
With $oRP; Object tag pool
.OLEDrag()
.Font = 'Arial'
.SelColor = 0x0000ff
.seltext = "Hello - Au3 supports ActiveX components like the RICHTEXT thanks to SvenP" & @CRLF & 'Try write some text and quit to reload'
;.FileName = @ScriptDir & '\RichText.rtf'
.BackColor = 0xff00
.MultiLine = True
;~ .ScrollBars = "Vertical"
.seltext = @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & "TEST"
EndWith
GUISetState ();Show GUI
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
;~ $oRP.SaveFile( @ScriptDir & "\RichText.rtf", 0 )
ExitLoop
Case $msg = $TagsPageC
Run(@ComSpec & ' /c start [URL]http://www.myplugins.info/guids/typeinfo/typeinfo.php?clsid=[/URL]{3B7C8860-D78F-101B-B9B5-04021C009402}','', @SW_HIDE)
Case $msg = $AboutC
$oRP.AboutBox()
Case $msg = $PrefsC
$oRP.SelFontSize = 20
DllCall("user32.dll", "int", "SendMessage", "hwnd", $GUIActiveX, "int", 0xB6, "int", 0, "int",100)
Case $msg = $StatC
$oRP.SelBold = False
$oRP.SelItalic = False
$oRP.SelUnderline = True
$oRP.SelFontSize = 8
$oRP.SelColor = 0x0000ff
EndSelect
WEnd
Exit
Func MyErrFunc()
$HexNumber=hex($oMyError.number,8)
Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _
"err.description is: " & @TAB & $oMyError.description & @CRLF & _
"err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _
"err.number is: " & @TAB & $HexNumber & @CRLF & _
"err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _
"err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _
"err.source is: " & @TAB & $oMyError.source & @CRLF & _
"err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _
"err.helpcontext is: " & @TAB & $oMyError.helpcontext _
,5)
; Will automatically continue after 5 seconds
SetError(1) ; to check for after this function returns
Endfunc
Alles anzeigen