Thema: Delphi FontDialog & ColorDialog

Einzelnen Beitrag anzeigen

Doctor

Registriert seit: 14. Jun 2004
18 Beiträge
 
#1

FontDialog & ColorDialog

  Alt 16. Jul 2004, 12:49
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:
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;
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.

Kann mir da jemand helfen ?
MfG
Doctor
  Mit Zitat antworten Zitat