Topic: align field arabic RTL

Dears, can anyone tell me how to make the field and grid be aligned for "Right to Left" for arabic  instead of left.  Also results in grid also to display for Grid, excel in right ?

Appreciate any help.   Thank you!

Re: align field arabic RTL

In current version, you can do it using by script


For Text fields:

Form1.Edit1.Alignment := taRightJustify;

for Grid:
You should create event OnChange, for example you have 4 columns

procedure Form1_TableGrid1_OnChange (Sender: string);
begin
Form1.TableGrid1.Columns[0].Alignment := taRightJustify;
Form1.TableGrid1.Columns[1].Alignment := taRightJustify;
Form1.TableGrid1.Columns[2].Alignment := taRightJustify;
Form1.TableGrid1.Columns[3].Alignment := taRightJustify;
end;
Dmitry.

Re: align field arabic RTL

I never worked with a script before, very new to this,  for the text field, i put begin and then end; but I get an error ... do I need to put anything else?

begin
Form1.edFirstName.Alignment := taRightJustify;
Form1.edLastName.Alignment := taRightJustify;
end;

Error is expected '.'


Also, for the second part, I get an error:    'BEGIN' expected

procedure Form1_GridSearch_OnChange (Sender: string);

begin
Form1.GridSearch.Columns[0].Alignment := taRightJustify;
Form1.GridSearch.Columns[1].Alignment := taRightJustify;
Form1.GridSearch.Columns[2].Alignment := taRightJustify;
Form1.GridSearch.Columns[3].Alignment := taRightJustify;
end;


This is simple fix for the error, thanks for your help!   - Yousef

Re: align field arabic RTL

Actually the first part worked for me, as I added a '.' after end.;

For the second part, the errors are gone, but it didn't work to display resulted columns right-alignment.. any advice ??  Thank You ..

Re: align field arabic RTL

I made project example for you.

Post's attachments

Attachment icon Employees right align TextBox and grid.zip 5.21 kb, 483 downloads since 2014-10-22 

Dmitry.

Re: align field arabic RTL

Thank you, I got it to work...  For the grid part, I went into the search button and revered the field name results... solved it in case anyone asked...

thanks again for your help!