var s: string; s:=TListBox(Control).items[index]; if copy(s, length(s), 1) = '~' then font.color:=clRed else font.color:=clBlack;
var theText: string;begin ... theText := (Control as TListBox).Items[Index]; if copy(theText, length(theText), 1) = '~' then ...