Jump to content
Sign in to follow this  

_GUICtrlRichEdit New Line of Text in Different Color

Recommended Posts



I am trying to setup an edit control which logs a process's successful steps and its errors. I am trying to do Normal Text (black). Error text (Bold and Red).

I see how to set the character color for a selection of text (_GUICtrlRichEdit_SetCharColor), but this requires character selection and it will be hard to keep track of which characters are in each new line.

Is there an easy way of doing this? I am not seeing a way in the help file.

Local $hGui, $hRichEdit, $iMsg
    $hGui = GUICreate("Example (" & StringTrimRight(@ScriptName,4) &")", 320, 350, -1, -1)
    $hRichEdit = _GUICtrlRichEdit_Create($hGui, "This is a test.", 10, 10, 300, 220, _
    _GUICtrlRichEdit_AppendText($hRichEdit, @CR & "This is more text")

    _GUICtrlRichEdit_SetCharColor($hRichEdit, "304050")

    _GUICtrlRichEdit_AppendText($hRichEdit, @cr & "This is more text")


    While True
        $iMsg = GUIGetMsg()
            Case $iMsg = $GUI_EVENT_CLOSE

Share this post

Link to post
Share on other sites

after further searching I found this...

thanks Melba!!

Edited by gcue

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.