![]() |
TFontDialog: wie einzelne Style-Typen extrahieren ?
Guten Abend.
Bevor ich einen Fontdialog aufrufe setze ich u.a. auch den Style
Delphi-Quellcode:
Wie kann ich jetzt nach Execute feststellen, welche Style-Art gesetzt wurde?
FontDialog1.Font.Style:= [];
if fsBold1 then FontDialog1.Font.Style:= FontDialog1.Font.Style + [fsBold]; if fsItalic1 then FontDialog1.Font.Style:= FontDialog1.Font.Style + [fsItalic]; ...
Delphi-Quellcode:
Danke Hanns
if FontDialog1.Execute then begin
FontName1 := FontDialog1.Font.Name; fontSize1 := FontDialog1.Font.Size; fsBold1 := ??????? |
Re: TFontDialog: wie einzelne Style-Typen extrahieren ?
Hallo,
das geht beispielsweise so:
Delphi-Quellcode:
Analog geht es mit den anderen Styles. Im folgenden Beispiel als if-Anweisung:
fsBold1 := fsBold in FontDialog1.Font.Style; // falls fsBold1 ein Boolean ist
Delphi-Quellcode:
Grüße, Matze
if fsBold in FontDialog1.Font.Style then
ShowMessage('bold'); if fsItalic in FontDialog1.Font.Style then ShowMessage('italic'); if fsUnderline in FontDialog1.Font.Style then ShowMessage('underline'); if fsStrikeOut in FontDialog1.Font.Style then ShowMessage('strike out'); |
Re: TFontDialog: wie einzelne Style-Typen extrahieren ?
:thumb: Danke Matze,
das Wars happy Hanns |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:44 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz