[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

TRichEdit control, doesn't allow me to change Alignment

Posted on 1998-11-19
4
Medium Priority
?
131 Views
Last Modified: 2010-04-04
When I try to change the alignment of a TRichEdit control at run time it doesn't work.

What's wrong with my code?
MyEditControl.Alignment := taCenter;


0
Comment
Question by:JasonC
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1347384
The alignment property of a TRichEdit refers to the left, center or right alignment of text within it.

Use the Align property instead. Unfortunately the Align property doesn't let you center so you will need to adjust the top and left properties to center the component.

Cheers,

Raymond.
0
 

Author Comment

by:JasonC
ID: 1347385
I'm sorry you got the wrong impression, but I am trying to change the alignment of the text within the control.

This shuld work, I know, but it will only work if I change the properties in the design environment.
0
 
LVL 7

Accepted Solution

by:
BlackMan earned 300 total points
ID: 1347386
In a TRichEdit, as opposed to a TMemo, alignment works for a paragraph, so you'll have to select the text you want to align first.
Try
MyRichEdit.SelStart := 0;
MyRichEdit.SelLength := MyRichEdit.Text.Length

and then apply the alignment...

0
 

Author Comment

by:JasonC
ID: 1347387
These answers are good, but the problem I had was that the Alignment property does not seem to work unless the Align property has been set to something other than alNone.

Thanks for you responses.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question