Notifications
Clear all
[Closed] Color text in ListBox
May 29, 2022 6:51 pm
Hey guys!
I want to bring up an old topic.
How can I change the color of a row in listbox depending on its content? For example, if the string contains “blablabla”, then it is blue, if it does not contain – green
3 Replies
May 29, 2022 6:51 pm
There is a solution for color by index,
brush = if mod arg.index 2 == 0 then brushes.Red else brushes.Orange
but I’m interested in the content of the string and here I’m stuck
1 Reply
get item contents and check whatever you need
brush = if MatchPattern dnListBox.items.item[arg.index] pattern:"*a*" then brushes.Red else brushes.Black -- alternate between red and black
any item containing ‘a’ char is red now
May 29, 2022 6:51 pm
Great, man! Thanks!
Every time everything turns out to be easier than i think!