Discussion:
easy!
(too old to reply)
Stark
2009-11-30 23:14:25 UTC
Permalink
It must be easy... but can'ìt find a way. The content of DBEdits appears
very close to the top and left border. It doesn't look nice, but I could not
find a way to center it (a property like 'layout' for labels).
Is there a way ?
Maarten Wiltink
2009-12-01 09:40:28 UTC
Permalink
Post by Stark
It must be easy...
Why?
Post by Stark
but can'ìt find a way. The content of DBEdits
appears very close to the top and left border. It doesn't look nice,
but I could not find a way to center it (a property like 'layout'
for labels). Is there a way ?
Possibly. If TDBEdit inherits from TCustomEdit (or similar), and if
there is a protected property Align (or similar) in that, you can make
it locally visible by declaring an empty subclass of the relevant
class in your unit and casting your editbox to that class.

Derived classes build strictly on top of the memory layout of their
base classes, so as long as you don't add anything in that local class,
you can only access things that were already there, in the place where
they are - but now including protected members. This is a well-known
trick.

Groetjes,
Maarten Wiltink

Loading...