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 Frage (https://www.delphipraxis.net/29261-font-frage.html)

hansklok 6. Sep 2004 18:49


Font Frage
 
Hallo,

ich habe hier eine Procedure. Wenn ich nun über Toolbuttons die unteren Formatierungsstyle verpasse, den funktioniert immer nur der letzte Style. In diesem Falle StrikeOut. Warum

Delphi-Quellcode:
procedure TForm1.GetStyles(var Font: TFont; var Pen: TPen; var Brush: TBrush);
begin
  Font.Color:= Panel6.Color;
  Font.Name:= ComboBox4.Text;
  Font.Size:= StrToInt(ComboBox5.Text);
  Pen.Color:= Panel6.Color;
  Pen.Style:= TPenStyle(Form2.ComboBox1.ItemIndex);
  Pen.Width:= Form3.ComboBox1.ItemIndex+1;
  Brush.Color:= Panel7.Color;
  Brush.Style:= TBrushStyle(Form2.ComboBox2.ItemIndex);
[b][color=blue] //FontStyle Formatierungsstyles
  if ToolButton23.Down then // funktioniert nicht
     Font.Style:= [fsBold] else Font.Style:= [];
  if ToolButton24.Down then // funktioniert nicht
     Font.Style:= [fsItalic] else Font.Style:= [];
  if ToolButton25.Down then // funktioniert nicht
     Font.Style:= [fsUnderline] else Font.Style:= [];
  if ToolButton26.Down then // funktioniert
     Font.Style:= [fsStrikeOut] else Font.Style:= [];[/[/color]b]
end;
Danke für eure Vorschläge!

mirage228 6. Sep 2004 18:56

Re: Font Frage
 
Delphi-Quellcode:
procedure TForm1.GetStyles(var Font: TFont; var Pen: TPen; var Brush: TBrush);
begin
  Font.Color:= Panel6.Color;
  Font.Name:= ComboBox4.Text;
  Font.Size:= StrToInt(ComboBox5.Text);
  Pen.Color:= Panel6.Color;
  Pen.Style:= TPenStyle(Form2.ComboBox1.ItemIndex);
  Pen.Width:= Form3.ComboBox1.ItemIndex+1;
  Brush.Color:= Panel7.Color;
  Brush.Style:= TBrushStyle(Form2.ComboBox2.ItemIndex);
  Font.Style := [];
  if ToolButton23.Down then
     Font.Style:= Font.Style + [fsBold];
  if ToolButton24.Down then
     Font.Style:= Font.Style + [fsItalic];
  if ToolButton25.Down then
     Font.Style:= Font.Style + [fsUnderline];
  if ToolButton26.Down then
     Font.Style:= Font.Style + [fsStrikeOut];
end;
Versuch es mal so ;)

mfG
mirage228

hansklok 6. Sep 2004 19:04

Re: Font Frage
 
Danke, hat funktioniert. Ich habe gesehen, du arbeitest mit Delphi 8 Professional, hast du als Schüler so viel Geld?

mirage228 6. Sep 2004 19:44

Re: Font Frage
 
Zitat:

Zitat von hansklok
Danke, hat funktioniert. Ich habe gesehen, du arbeitest mit Delphi 8 Professional, hast du als Schüler so viel Geld?

Hi,

bitte sehr ;) -
zu Delphi 8: meine Eltern haben mir das Upgrade auf Delphi 8 (von Delphi 3 Prof.) zu Weihnachten geschenkt. :)

mfG
mirage228


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