Jump to content
Sign in to follow this  

Listbox Colored items or alternative?

Recommended Posts


Hey guys,

I'm a total n00b on Listboxes/listviews.

About a year ago I wanted a status window that allows me to display status messages for a script and I used the following code:

$gui_status = GUICreate("Status", 233, 539, 786, 0)
$list_status = GUICtrlCreateList("", 7, 7, 219, 490, $WS_BORDER + $WS_VSCROLL);x=-30 y=-40

Func Status($msg)
    _GUICtrlListBox_AddString ($list_status, $msg)
    _GUICtrlListBox_SetTopIndex ($list_status, _GUICtrlListBox_GetCount ($list_status) - 1)

Status("blablabla Finished")

Status("error in script")

etc. etc.

This works fine, however I'd like to display particular messages in a specific color. For instance, all messages are black (standard) but lines containing error messages are displayed in red.

Is this possible?

Or do I have to use another control like a listview?

If so, could someone make an example of code that creates the listview and a function to add lines like the Status function?

I tried messing around with listview, but the functions are so extensive, I don't really know where to begin.


Share this post

Link to post
Share on other sites

You'd probably want to search the example forum for some RichEdit UDFs.

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