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.
- mtartaglia
- Posts: 101
- Last visit: Mon Dec 19, 2022 11:45 am
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]
}