![]() |
FontDialog & ColorDialog
Hallo
Ich möchte gerne über ein Menu die Schriftfarbe und Schriftart des Panels ändern, auf dem ich einige Edits und Panals untergebracht habe. Ich hab da mal n bischen getestet und die Delphi-Hilfe bringt mich net wirklich weiter. aus der Delphi Hilfe:
Delphi-Quellcode:
Teilweise versteh ich das ja, aber es klappt net so, wie ich das will ... ausserdem hab ich keine Ahnung, wie ich das mit dem ColorDialog machen soll.
procedure TForm1.Button1Click(Sender: TObject);
begin TFontDialog1.Options = TFontDialog1.Options + fdApplyButton; TFontDialog1.Execute; end; procedure TForm1.FontDialog1Apply(Sender: TObject; Wnd: Integer); begin if ActiveControl is TEdit then with ActiveControl as TEdit do Font.Assign(TFontDialog(Sender).Font) else if ActiveControl is TRichEdit then with ActiveControl as TRichEdit do SelAttributes.Assign(TFontDialog(Sender).Font) else Beep; end; Kann mir da jemand helfen ? MfG Doctor |
Re: FontDialog & ColorDialog
Delphi-Quellcode:
Wobei im TFontDialog auch schon einige Schriftfarben zur Auswahl stehen.
{ Font auswählen }
procedure TForm1.SelFontClick(Sender: TObject); begin if fontDlg.Execute then begin Label1.Font.Assign(FontDialog1.Font); end; end; { Farbe auswählen } procedure TForm1.SelColorClick(Sender: TObject); begin if colorDlg.Execute then begin Label1.Font.Color := colorDlg.Color; end; end; Gruß Stephan |
Re: FontDialog & ColorDialog
klar kann man die farben schon im font dialog auswählen.
der colordialog ist ja für den hintergrund des programms gedacht trotzdem mal danke mfg doc |
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:51 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