Jump to content
Sign in to follow this  
McGod

Could this be done

Recommended Posts

McGod

Ok Im making a GUI Log. So I wish to make something like

*******************

Error Occured: Something happened

*******************

=====================

Passed working now

=====================

In a GUI Edit, so different color text.

Share this post


Link to post
Share on other sites
Paulie

different color text.

GuiCtrlSetColor()

Share this post


Link to post
Share on other sites
McGod

Would that work for different colors in the same control? Like in my edit control I could have red green yellow etc..

Or will I have to do a GUICtrlCreateLabel for each line ? :)

Edited by Chip

Share this post


Link to post
Share on other sites
Paulie

Would that work for different colors in the same control? Like in my edit control I could have red green yellow etc..

I'm not sure, but i think its worth a try

considering its an error log I'm assuming you are having a program write this no?

If this is the case, can we see the portion of the code that writes the file?

Edit: i guess this wouldn't work...

I made this code to test it

#Include <GuiConstants.au3>
#Include <Misc.au3>

Global $Color = 0x000000

$GUI = GUICreate("Test Multi-color Edit", 400, 300)
$Edit = GUICtrlCreateEdit("Type here", 0, 0, 250, 250)
$Button = GUICtrlCreateButton("Color", 300, 40, 50, 25)
GUISetState()

While 1
    $Msg = GUIGetMsg()
    
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button
            $Color = _ChooseColor()
            GUICtrlSetColor($Edit, $Color)
    EndSwitch
WEnd
Edited by Paulie

Share this post


Link to post
Share on other sites
McGod

TY, worked perfectly! Exactly what i was looking for.

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.