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 Font.Style auslesen (https://www.delphipraxis.net/11359-font-style-auslesen.html)

Nalincah 5. Nov 2003 08:57


Font.Style auslesen
 
Wenn ich einen kursiven und fetten Text hab, dann sieht die Eigenschaft "Font.Style" so aus "[fsBold,fsItalic]"

Wie kann ich jetzt feststellen ob der Font-Style z.b. die Eigenschaft "fsBold" enthält

hier etwas pseudocode:

Delphi-Quellcode:
begin
  wenn fsBold in Font.Style vorkommt dann
    mache irgendwas
end;

sakura 5. Nov 2003 09:08

Re: Font.Style auslesen
 
Hast Du doch schon selbst geschrieben - jetzt nur noch übersetzen ;-)

Delphi-Quellcode:
begin
  if fsBold in Font.Style them
    Foo;
end;
...:cat:...

Sharky 5. Nov 2003 09:08

Re: Font.Style auslesen
 
Hai General2003.

Zitat:

Zitat von General2003
Delphi-Quellcode:
begin
  wenn fsBold in Font.Style vorkommt dann
    mache irgendwas
end;


Ist doch schon zu 97% richtig ;-)

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
 if (fsbold IN Label1.Font.Style) then
  begin
   ShowMessage ('Label ist Fett');
  end;
end;


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