We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

Alignment in Edit fields

mvsatis
mvsatis asked
on
Medium Priority
190 Views
Last Modified: 2010-04-04
How do I right allign numeric data in a Tedit field?
Comment
Watch Question

Commented:
I can give you a component called a TCurrencyEdit it has an Alignment property (right, center, left) it also has decimal places and DisplayFormat so you can put in things like $, lbs, ect...it is from the Rx Libraries, you can download them free at
http://www.rx.demo.ru
http://www.kki.net.pl/rxlib/


Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
Hi,
On DSP there is a fw component that might do it. Haven't tested it myself, so...
http://sunsite.icm.edu.pl/delphi/ftp/d10free/gestedit.zip

/// John

Commented:
NOW I have tested it, and it seems to work very well...?!?!

/// John

Commented:
...It is actually a simple solution to some other of my needs...
.especially valid char masking.
Thank you David Robledo Fernández!

/// John

Commented:
Simplest way:

Subclass the TEdit component
Override the createParam method
In your createParam method, set the ParamStyle

Let me know if you need code.


Commented:
kjteng, that's indeed a simple way, make another component. But then again, why not using one which already exist?

Ok, but we all agree that it isn't possible to do with the native TEdit... except is is somewhat possible with the native TMemo.

Zif.

Commented:
Zif:
Sorry I didn't see your answer when I post the comment - something wrong with my browser.

Why not using one which already exist?
IMHO,
If ( what we want is just a simple task such as aligning text)
  and (we do not need the extra features provided by the third   party component) then
it is better to write our own component as this will minimise the overheads.

By the way where is Matvey's comment? I can see it in the browser.



Commented:
mmm, yes strange this happen here, where is Matvey's comment.
kjteng, write, if it is for simple extension, new component is better.

Author

Commented:
OK I have tested your solution and it works,but it is a little bit teddious.
Now I have found on the net several components who will tho this job more easaly.

Look to www.torry.ru (excellent site) or DSP.


           
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.