Jump to content

Set different colors for List View rows? [SOLVED]


sandman
 Share

Recommended Posts

I have a list view that I want to urge importance by coloring the important rows red, and leaving the rest default. I know this is possible, but how could I do it? If this is too hard to do also being able to insert some kind of image inside a list view row would also work.

Thanks,

SANDMAN!

Edited by sandman

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

Nevermind, I used GUICtrlSetColor and GUICtrlSetBkColor on the individual GUICtrlCreateListViewItem controls to make this work.

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

Nevermind, I used GUICtrlSetColor and GUICtrlSetBkColor on the individual GUICtrlCreateListViewItem controls to make this work.

wow this is cool, i didnt knew this was possible. A new enhancement for my GUI's.

EDIT: Hmm this sucks, how do i get the handle/Control ID of an ListViewItem that i created previously. I know i could store every itemID in a seperate variable, but i have many ListViewItems and i dont want to mess around with Arrays. Beside i preferr to work with _GUICtrlListViewInsertItem and _GUICtrlListViewSetItemText. And those dont return any Handle/ID

Isn't there an simple Function like _GUICtrlListViewGetItemHandle ? I didnt found any in UDF's, nor Auto3Lib

Edited by qsek
Teamspeak 3 User Viewer - Quick and functional TS3 Query script, which shows online users.Cached Screenshot Deleter - Deletes older Fraps Screenshots if they exceed a specified limit.Unresolved Topics:Intercept and modify dragdrop text behaviour in scite
Link to comment
Share on other sites

  • 1 year later...

Cheers Sandman, this is what i needed to know.

qsek, I know this is a little late but this is how I'd do it...

GUICreate("")
GUISetState(@SW_SHOW)

$ListView = GUICtrlCreateListView("", 0, 0, 80, 200, 0x03)
$LIST = StringSplit("Item1|Item2|Item3|Item4|Item5|Item6|Item7|Item8|Item9|Item10","|")

Dim $ListViewItemArray[$LIST[0]]

For $i = 1 To UBound($LIST) - 1
    $ListViewItemArray[$i - 1] = GUICtrlCreateListViewItem($LIST[$i], $ListView)
Next

For $i = 0 To UBound($ListViewItemArray) - 1
    GUICtrlSetBkColor($ListViewItemArray[$i], 0xAA0000 + 20 * $i)
Next

Sleep(3000)

I know you didn't want to use arrays, but it is a very powerful tool to pass over from the get go. expecially when working with bazillians of instances with the same properties...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...