![]() |
Frage zu Fontdialog
Hallo,
wie mache ich es, damit ich in einem Richedit-Textfeld verschiedene Schriften und Farben einstellen kann ?
Delphi-Quellcode:
.........mit diesem Code stimmt etwas nicht ganz
procedure TForm6.BitBtn1Click(Sender: TObject);
begin if fontdialog1.execute then richedit1.font:= fontdialog1.Font; end; .....mit diesem Code wechselt immer der gesamte Text die Farbe und Schrift |
Re: Frage zu Fontdialog
Hallo,
schaue dir mal die ![]()
Delphi-Quellcode:
Oder so ähnlich. ;)
RichEdit1.SelAttributes.Font := FontDialog1.Font;
Grüße, Matze |
Re: Frage zu Fontdialog
Danke
ich habs gefunden, so muß es heißen
Delphi-Quellcode:
.
. . Richedit1.SelAttributes.Name := FontDialog1.Font.Name; Richedit1.SelAttributes.Size := FontDialog1.Font.Size; Richedit1.SelAttributes.Style := FontDialog1.Font.Style; |
Re: Frage zu Fontdialog
Du kannst es auch mit
Delphi-Quellcode:
versuchen ;)
Richedit1.SelAttributes.Font.Assign(FontDialog1.Font);
|
Re: Frage zu Fontdialog
Zitat:
FEHLER |
Re: Frage zu Fontdialog
Zitat:
|
Re: Frage zu Fontdialog
Zitat:
TTextattributes hat kein Element namens 'Font' in Zeile........ Der zeigt bei mir hinter " Richedit1.SelAttributes" kein "Font" an liegts an Delphi 2005 ? |
Re: Frage zu Fontdialog
So geht's:
Delphi-Quellcode:
if FontDialog1.Execute then
RichEdit1.SelAttributes.Assign(FontDialog1.Font); |
Re: Frage zu Fontdialog
Zitat:
Manchmal stelle ich rote Farbe ein , und er schreibt trotzdem schwarz weiter, dann wieder funktioniert es. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:49 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 by Thomas Breitkreuz