senatin Posted October 16, 2017 Share Posted October 16, 2017 (edited) expandcollapse popup#include <GuiRichEdit.au3> #include <WindowsConstants.au3> HotKeySet ("-", "InsertText") HotKeySet( "=", "Turnoff") $Form1 = GUICreate("Senatin", 466, 422, 79, 132) $Tab1 = GUICtrlCreateTab(5, 0, 457, 420) ;~ ;TabSheet1 $TabSheet1 = GUICtrlCreateTabItem("Main") $hRichEdit = _GUICtrlRichEdit_Create($Form1, "", 12, 161, 241, 249, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While 1 Sleep(100) WEnd Func InsertText() ; Count the @CRLFs StringReplace(_GUICtrlRichEdit_GetText($hRichEdit, True), @CRLF, "") Local $iLines = @extended ; Adjust the text char count to account for the @CRLFs Local $iEndPoint = _GUICtrlRichEdit_GetTextLength($hRichEdit, True, True) - $iLines ; Add new text _GUICtrlRichEdit_AppendText($hRichEdit, "test on Test" & @CRLF) ; Select text between old and new end points _GuiCtrlRichEdit_SetSel($hRichEdit, $iEndPoint, -1) ; Convert colour from RGB to BGR $iColor = Hex(0xff0000, 6) $iColor = '0x' & StringMid($iColor, 5, 2) & StringMid($iColor, 3, 2) & StringMid($iColor, 1, 2) ; Set colour _GuiCtrlRichEdit_SetCharColor($hRichEdit, $iColor) ; Set size _GUICtrlRichEdit_ChangeFontSize($hRichEdit, 0) ; Set weight _GUICtrlRichEdit_SetCharAttributes($hRichEdit, "-bo") ; Clear selection _GUICtrlRichEdit_Deselect($hRichEdit) EndFunc Func Turnoff() GUIDelete($Form1) Exit EndFunc When The RichEdit become full by pressing "-" The Old Text become color white and Richedit losses its form. can Someone Please Help me Fix this. Thank you Oh I figure it out Puting RichEdit Before Creation of Tab is the solution. Edited October 16, 2017 by senatin Link to comment Share on other sites More sharing options...
Danyfirex Posted October 17, 2017 Share Posted October 17, 2017 Hello. Create the RicthEdit into the Tab Control. $hRichEdit = _GUICtrlRichEdit_Create(GUICtrlGetHandle($Tab1), "", 12, 161, 241, 249, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) Saludos kylomas 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
senatin Posted October 17, 2017 Author Share Posted October 17, 2017 (edited) Thank you so much Thats Why I really Looking for Ops something went wrong again when I click tabs The richEdit become buggy again. Edited October 17, 2017 by senatin Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now