TListItem does not have a MinWidth property, you meant TListColumn instead.
In any case, what version of Delphi are you using? I can reproduce the problem in Delphi 12 w/ Patch 1 installed. When dragging a column divider in the header, the TListColumn.MinWidth and TListColumn.MaxWidth values get ignored when the TListView is processing an HDN_ITEMCHANGING notification from the header. TListView looks for HDN_ITEMCHANGING to trigger a redraw of the active TListItem, but there is an 'else' that skips the MinWidth/MaxWidth processing:
if (Mask and HDI_WIDTH) <> 0 then
begin
if code = HDN_ITEMCHANGING then
EnsureItemRedrawn(nil)
else // <-- HERE!!
begin
Col := GetColumnFromTag(Item);
if Col.MinWidth >= cxy then
cxy := Col.MinWidth
else
if (Col.MaxWidth > 0) and (Col.MaxWidth <= cxy) then
cxy := Col.MaxWidth;
Col.Width := cxy;
end;
end;
When I take that 'else' out, the MinWidth/MaxWidth values work properly as expected:
if (Mask and HDI_WIDTH) <> 0 then
begin
if code = HDN_ITEMCHANGING then
EnsureItemRedrawn(nil);
//else // <-- HERE!!!
begin
Col := GetColumnFromTag(Item);
if Col.MinWidth >= cxy then
cxy := Col.MinWidth
else
if (Col.MaxWidth > 0) and (Col.MaxWidth <= cxy) then
cxy := Col.MaxWidth;
Col.Width := cxy;
end;
end;
This bug does not exist in Delphi 10.3, so it was introduced sometime after that version:
if (Mask and HDI_WIDTH) <> 0 then
begin
// NO redraw LOGIC HERE!!!
Col := GetColumnFromTag(Item);
if Col.MinWidth >= cxy then
cxy := Col.MinWidth
else
if (Col.MaxWidth > 0) and (Col.MaxWidth <= cxy) then
cxy := Col.MaxWidth;
Col.Width := cxy;
end;
I would suggest filing a bug report with Embarcadero, but Quality Portal is still down. I'll report it privately.