Recent

Author Topic: [SOLVED] TDBEdit Alignment  (Read 731 times)

johnmc

  • Jr. Member
  • **
  • Posts: 51
[SOLVED] TDBEdit Alignment
« on: October 22, 2024, 12:58:46 pm »
I want to set the alignment of a couple of TDBEdit to be right aligned.
I have tried:
Setting at design time in the Object inspector, doesn't work!
Adding
Code: Pascal  [Select][+][-]
  1. DBEdit1.Alignment := taRightJustify;
in the FormCreate, didn't work, and FormActivate procedures. In the FormActivate, it worked for the first item displayed but as soon as the next item was selected by the DBNAV it reverts to left justify.
Documentation indicates that the property is available and that it takes its defaults from the Tfield.
Where and how do I set this so that it is right justified?

Using:
Lazarus 3.4 (rev lazarus_3_4) FPC 3.2.2 x86_64-win64-win32/win64
with my DB in Sqlite3. 3.27.2.0
« Last Edit: October 22, 2024, 01:30:03 pm by johnmc »

rvk

  • Hero Member
  • *****
  • Posts: 7061
Re: TDBEdit Alignment
« Reply #1 on: October 22, 2024, 01:07:15 pm »
Where and how do I set this so that it is right justified?
For the TDBEdit it gets it alignment from the data-field (i.e. TSQLQuery.FieldByName('xx').Alignment).

So you need to set that one to taRightAligned and it will keep it's alignement after scroll of the dataset.

(BTW. That will also get you the correct alignment in the TDBGrid you might have ;) )

johnmc

  • Jr. Member
  • **
  • Posts: 51
Re: TDBEdit Alignment
« Reply #2 on: October 22, 2024, 01:26:56 pm »
Thanks that works.


 

TinyPortal © 2005-2018