Link to home
Start Free TrialLog in
Avatar of mvsatis
mvsatis

asked on

Alignment in Edit fields

How do I right allign numeric data in a Tedit field?
Avatar of Greedy
Greedy

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/


ASKER CERTIFIED SOLUTION
Avatar of ZifNab
ZifNab

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
NOW I have tested it, and it seems to work very well...?!?!

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

/// John
Simplest way:

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

Let me know if you need code.


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.
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.



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

ASKER

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.