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/)
-   -   Delphi TFont mit default-Wert beschreiben (https://www.delphipraxis.net/45394-tfont-mit-default-wert-beschreiben.html)

Helmi 5. Mai 2005 13:10


TFont mit default-Wert beschreiben
 
Hallo,

ich hab eine Komponente mit einer Property abgeleitet von TFont.

Jetzt möcht ich gerne dieser Property einen Default-Font-Wert geben.

Wie mach ich das am besten?

ich hab folgendes:
Delphi-Quellcode:
    property BalloonTipTitleFont: TFont read FBalloonTipTitleFont
      write SetBalloonTipTitleFont;

{...}

procedure OnCreate(Sender: TObject);

  //Font für Titel erzeugen
  FBalloonTipTitleFont := TFont.Create;

  with FBalloonTipTitleFont do
    begin
      Charset  := DEFAULT_CHARSET;
      Color    := clBlack;
      Name     := 'MS Sans Serif';
      Size     := 9;
      Style    := [fsBold];

      OnChange := OnTitleFontChange;
    end;
Nur kann ich im OnCreate reinschreiben was ich will, im OI wird immer ein (wahrscheinlich) Systemwert angezeigt!

Bernhard Geyer 5. Mai 2005 15:33

Re: TFont mit default-Wert beschreiben
 
Die Initialisierung muss im Konstruktor deiner Komponente erfolgen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:22 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