Delphi7。我有固定ItemHeight的列表框,OwnerDrawn。现在我想让它在125%的Windows字体上看起来还行。目前我看到项目字体增加了,但ItemHeight没有,所以项目被Y“截断”了。当操作系统有125%或150%的字体大小时,如何调整ItemHeight?
发布于 2013-02-14 23:53:40
无法将OnMeasureItem用作List.Style=OwnerDrawFixed。我的sol:
function ScaleFontSize(Size: Integer; Form: TForm): Integer;
begin
Result:= Size * Form.PixelsPerInch div 96 + 1;
end;
procedure TfmSetup.TntFormCreate(Sender: TObject);
begin
with ListTabColors do
ItemHeight:= ScaleFontSize(ItemHeight, Self);
end;https://stackoverflow.com/questions/14878134
复制相似问题