How can I customize the Row Height of a TListView?

544 Views Asked by At

In a 32-bit VCL Application in Windows 10 in Delphi 11 Alexandria, I use a TListView where ViewStyle = vsReport.

How can I customize the Row Height of a TListView, BOTH when OwnerDraw is True or False?

I tried this approach:

type
  TListView = class(ComCtrls.TListView)
  private
    procedure CNMeasureItem(var Message: TWMMeasureItem); message CN_MEASUREITEM;
  end;

...

procedure TListView.CNMeasureItem(var Message: TWMMeasureItem);
begin
  inherited;
  Message.MeasureItemStruct.itemHeight := 32;
end;

However, this works only if OwnerDraw = True. Is there no other solution?

0

There are 0 best solutions below