ListView Detect Negative Numbers in Column 0 (Caption)

JBALES
JBALES used Ask the Experts™
on
I know how to detect negative numbers in SubItems using the code below but how would I go about doing it in column 0?

if (SubItem = 5) and (Item.SubItems[2] > 0) then
    // Display negative values in column 5 in red
    ListView1.Canvas.Font.Color := clRed
  else
    // Display all other sub item colums in green
    ListView1.Canvas.Font.Color := clGreen;

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010

Commented:
use ListView1.Items.Caption property

if ListView1.Items.Caption = 'Something' then
  ...
Top Expert 2010
Commented:
sorry typo

ListView1.Items[0].Caption

or (as in your question)

Item.Caption

Author

Commented:
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial