![]() |
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:
Danke für eure Vorschläge!
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; |
Re: Font Frage
Delphi-Quellcode:
Versuch es mal so ;)
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; mfG mirage228 |
Re: Font Frage
Danke, hat funktioniert. Ich habe gesehen, du arbeitest mit Delphi 8 Professional, hast du als Schüler so viel Geld?
|
Re: Font Frage
Zitat:
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 13:50 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