Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Memo zeile zentrieren (https://www.delphipraxis.net/27250-memo-zeile-zentrieren.html)

HaZe 6. Aug 2004 13:32


Memo zeile zentrieren
 
Hi

ich hoffe ich hab das richtige forum getroffen :).
also ich brauch ne funktion, wie ich Nur eine zeile zentrieren kann. Ich hab zwar scho die Suche und Google vergewaltigt, aber nix gefunden.

hat jemand ne idee ?

cYa

Luckie 6. Aug 2004 13:35

Re: Memo zeile zentrieren
 
Mit einem memo läßt sich kein formatierter Text darstellen. Dazu musst du ein RichEdit nehmen. Interessant für dich ist dann die Eigenschaft Delphi-Referenz durchsuchenSelAttributes.

teebee 6. Aug 2004 14:07

Re: Memo zeile zentrieren
 
Das geht dann aber nicht mit SelAttributes, sondern so:
Delphi-Quellcode:
RichEdit1.Paragraph.Alignment := taCenter;
Gruß, teebee

sakura 6. Aug 2004 14:08

Re: Memo zeile zentrieren
 
Zitat:

Zitat von teebee
Das geht dann aber nicht mit SelAttributes, sondern so

Es geht beides, je nach aktueller Notwendigkeit ;)

...:cat:...

teebee 6. Aug 2004 14:25

Re: Memo zeile zentrieren
 
Wie geht es denn mit SelAttributes? In der OH zu D5 finde ich es jedenfalls nicht...

Gruß, teebee

sakura 6. Aug 2004 14:32

Re: Memo zeile zentrieren
 
Zitat:

Zitat von teebee
Wie geht es denn mit SelAttributes? In der OH zu D5 finde ich es jedenfalls nicht...

Meine Hilfe (D7) schreibt:
SelAttributes property (TCustomRichEdit)

Describes the rich text characteristics of the selected text in the rich edit control.

Delphi syntax:

property SelAttributes: TTextAttributes;

C++ syntax:

__property TTextAttributes* SelAttributes = {read=FSelAttributes, write=SetSelAttributes};

Description

Use SelAttributes to discover or set the font characteristics of the currently selected text. SelAttributes specifies characteristics such as font face, color, size, style, and pitch. To change a single attribute of the currently selected text, read SelAttributes, and set one of its properties. To change all of the attributes of the currently selected text, set SelAttributes to a TTextAttributes object that represents the desired configuration of attributes. If no text is selected, SelAttributes represents the attributes of the cursor position.

When inserting new text, the font characteristics of the new text will match SelAttributes.

Note: SelAttributes is available only at runtime.


SelAttributes wird also auf den markierten Text angewandt ;) (bzw. da wo der Cursor steht, wenn kein Text markiert ist)

...:cat:...

teebee 6. Aug 2004 14:35

Re: Memo zeile zentrieren
 
Wie man SelAttributes anwendet sollte wohl klar sein...

Aber wo befindet sich in TTextAttributes ein Property für das Alignmnet des Textes? Das gibt es nur in unter TParaAttributes und damit unter Paragraph.

Gruß, teebee


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