Search the Community
Showing results for tags 'colours'.
-
Hi, is there a way to convert this Code to an Code which can make more than one Color in one line? Func _GUICtrlRichEdit_WriteLine($hWnd, $sText, $iIncrement = 0, $sAttrib = "", $iColor = -1) ; Count the @CRLFs StringReplace(_GUICtrlRichEdit_GetText($hWnd, True), @CRLF, "") Local $iLines = @extended ; Adjust the text char count to account for the @CRLFs Local $iEndPoint = _GUICtrlRichEdit_GetTextLength($hWnd, True, True) - $iLines ; Add new text _GUICtrlRichEdit_AppendText($hWnd, $sText & @CRLF) ; Select text between old and new end points _GuiCtrlRichEdit_SetSel($hWnd, $iEndPoint, -1) ; Convert colour from RGB to BGR $iColor = Hex($iColor, 6) $iColor = '0x' & StringMid($iColor, 5, 2) & StringMid($iColor, 3, 2) & StringMid($iColor, 1, 2) ; Set colour If $iColor <> -1 Then _GuiCtrlRichEdit_SetCharColor($hWnd, $iColor) ; Set size If $iIncrement <> 0 Then _GUICtrlRichEdit_ChangeFontSize($hWnd, $iIncrement) ; Set weight If $sAttrib <> "" Then _GUICtrlRichEdit_SetCharAttributes($hWnd, $sAttrib) ; Clear selection _GUICtrlRichEdit_Deselect($hWnd) EndFunc
-
Hello, Today I have a new question about edit box control, please look at the image below: I want the colors as specified for each event.... Code for the edit box: $output_terminal = GUICtrlCreateEdit("[INFO] Welcome to the Developer Console" & @CRLF,0,285,546,124,2048,-1) Code for the function which is used by the whole program: Func SendEvent($type, $msg) If $type = 0 Then $type = '[OKAY] ' If $type = 1 Then $type = '[EROR] ' If $type = 2 Then $type = '[WARN] ' If $type = 3 Then $type = '[INFO] ' GUICtrlSetData($output_terminal, $type & $msg & @CRLF, 1) EndFunc Thanks in advance