Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi RichEdit + FontDialog (https://www.delphipraxis.net/14099-richedit-fontdialog.html)

Moin 2. Jan 2004 11:10


RichEdit + FontDialog
 
Tach erst ma!

Ich würde gerne mit einem FontDialog den Markierten Text einer RichEdit
Formatieren, hab auch schon lange im Forum gesucht und viel gefunden.
Troz dem funzt es nich
Ich brauche Hilfeeee!!!
:!:

Delphi-Quellcode:
If FontDialog.Execute
      Then
         With Rich.SelAttributes do
          begin  Font := FontDialog.Font;
                  Font.Style := FontDialog.Font.Style;
                  Font.Color:= FontDialog.Font.Color;

          end;
Das programm startet zwar, aber der markierte Text verändert sich nich

Danke im Vorraus :?

P.S.: ich komm mir wie n absoluter Anfänger vor :cry:

Moin 2. Jan 2004 11:17

Re: RichEdit + FontDialog
 
Ich noch ma,
Delphi-Quellcode:
Font.Name := FontDialog.Font.Name;
funzt auch nich :cry:

Das einzige, das ich bisher hingegriegt habe ist "size"
ich will aber alle werte des Dialoges übernehmen;

Mirilin 2. Jan 2004 11:40

Re: RichEdit + FontDialog
 
:hi:

Im Demo Ordner von Delphi hat es ein Demoprogramm über das RichEdit.


mfg Tobias

Edit : Hab mich geirrt, die Demo wird Dir wohl nicht helfen

Keldorn 2. Jan 2004 12:47

Re: RichEdit + FontDialog
 
Hallo

gugg doch einfach mal in die Onlinehilfe oder nutz die Codevervollständigung. Selattributes hat keine Font-Eigenschaft. du gibst nur den Namen, Size etc. an.

Delphi-Quellcode:
  if FontDialog1.Execute then
    begin
      RichEdit1.SelAttributes.Name := FontDialog1.Font.Name;
      ...
    end;
das was du da rumänderst, wenn du Font.??? verwendest wird wohl der Font der Form sein. Und wenn es mit der Größe geklappt hat, dann haben sich auch alle Schriftgrößen deiner ganzen Kompos auf der Form mitgeändert, wenn dur parentfont auf true stehen hast.

Mfg Frank

Moin 2. Jan 2004 15:13

Re: RichEdit + FontDialog
 
:dancer: Danke für Eure Tips, ich habs zum Laufen gekriegt :dancer2:

deinmeister 17. Jan 2005 17:51

Re: RichEdit + FontDialog
 
oook bei mir ist es andersherum.... ich bekomm es mit der schriftart hin... aba size und fett,kursiv und unterstrichen geht nicht.... das nervt.... wie haste es denn da hin bekommen?

Keldorn 17. Jan 2005 19:25

Re: RichEdit + FontDialog
 
das geht doch genauso :roll:

Delphi-Quellcode:
  if FontDialog1.Execute then
    begin
      ...
      RichEdit1.SelAttributes.Style := FontDialog1.Font.Style;
      RichEdit1.SelAttributes.Size := FontDialog1.Font.size;
Mfg Frank


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