Is it possible to have different text colors for each item depending on an expression in a listbox? If so, please point me in the right direction .
Thank you,
Mike
Different text colors for each item in a listbox
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- miketartaglia
- Posts: 100
- Joined: Mon Feb 02, 2015 7:44 am
-
- Posts: 14667
- Joined: Tue May 22, 2007 9:57 am
- Has voted: 1 time
- Been upvoted: 5 times
- Contact:
Re: Different text colors for each item in a listbox
Hi Mike. You can use the "DrawItem" event to customize the colors of the lines in a ListBox.
Code: Select all
$listbox1_DrawItem=[System.Windows.Forms.DrawItemEventHandler]{
#Event Argument: $_ = [System.Windows.Forms.DrawItemEventArgs]
}