I just tested it: Set ListBox.Style to lbVirtual, ListBox.Count to some value, and provided a handler for OnData. That's all to set virtual mode.
Then I switched ItemHeight to a new value --> the height of the items in the listview changes accordingly.
I added an empty OnDrawItem handler --> the items are gone, there is a uniform gray background. I completed the OnDrawItem with
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
ARect: TRect; State: TOwnerDrawState);
begin
if Odd(Index) then
begin
Listbox1.Canvas.Font.Style := [fsBold];
Listbox1.Canvas.Brush.Color := clMoneyGreen;
end else
begin
Listbox1.Canvas.Font.Style := [fsItalic];
Listbox1.Canvas.Brush.Color := clWindow;
end;
if ([odSelected, odFocused] * State <> []) then
begin
Listbox1.Canvas.Brush.Color := clHighlight;
Listbox1.Canvas.Font.color := clHighlightText;
end;
Listbox1.Canvas.FillRect(ARect);
Listbox1.Canvas.TextOut(ARect.Left+ 2, ARect.Top+2, Listbox1.Items[Index]);
end;
and now I can see alternating rows of bold/moneygreen and italic/white.
Conclusions: As Bart said, the style lbVirtual is able to customdraw the listbox items in virtual mode provided that an OnDrawItem handler is available. If not the default drawing code is used.