Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   TCheckBox zu schnal bei large fonts (150%) (https://www.delphipraxis.net/178924-tcheckbox-zu-schnal-bei-large-fonts-150-a.html)

hoika 4. Feb 2014 09:45

TCheckBox zu schnal bei large fonts (150%)
 
Hallo #,

ich teste hier gerade mal large Fonts.
Manche meiner CheckBoxen werdne bei 150% zu schnal angezeuigt.

Leider hat TCheckBox ja kein AutoSize.

Der Ansatz hier hilft nicht.
http://www.delphigroups.info/3/9/172328.html

Darauf aufbauend meine weiteren Bemühungen ...

Delphi-Quellcode:
         

var
  ACheckBox: TCheckBox

  iCxCheck := GetSystemMetrics(SM_CXMENUCHECK);
  dFactor := PixelsPerInch/96;

  if PixelsPerInch>96 then
  begin
    iCxCheck:= Round(iCxCheck*dFactor);
  end;



          ACheckBox := TCheckBox(Component);
          if PixelsPerInch=96 then
          begin
            iCheckBoxWidth := iCxCheck+4+Self.Canvas.TextWidth(ACheckBox.Caption);
          end
          else
          begin
            iCheckBoxWidth := iCxCheck+Round(4*dFactor)+Self.Canvas.TextWidth(ACheckBox.Caption);
          end;
          if iCheckBoxWidth>ACheckBox.Width then
          begin
            ACheckBox.Width := iCheckBoxWidth;
          end;
Klappt aber nicht

#Update:#
Das iCxCheck war immer noch zu klein,
jetzt klappt es

*freu*


Heiko


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:18 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz