list view column width 0 in oncreate after handle creation
Original Reporter info from Mantis: BeniBela @benibela
-
Reporter name: Benito van der Zander
Original Reporter info from Mantis: BeniBela @benibela
- Reporter name: Benito van der Zander
Description:
Here the column width is always 0 regardless of the designer settings:
procedure TForm1.FormCreate(Sender: TObject);
var
i, sum: Integer;
begin
Canvas.GetTextHeight('Hm,.|');;
sum := 0;
for i := 0 to ListView1.ColumnCount - 1 do
sum := sum + ListView1.Column[i].Width;
caption := IntToStr(sum);
end;
Additional information:
in my actual project it is even worse: reading width, sets width to 0, but it does not happen anywhere else
Mantis conversion info:
- Mantis ID: 34044
- Build: Lazarus 1.8.1 r55664M FPC 3.1.1
- Fixed in revision: r59047 (#5102a773)