Page 1 of 1

Selecting A cell in a table

Posted: Mon Dec 26, 2022 2:22 pm
by fara2000
Hello Sergey
In the Line Table1.cells[table1.RowCount-1,0].SetItemText(0,'Hello');
I need to force Aligning the word 'Hello' horizontally at the center of the Cell. How to do that???
Thank you in advance

Re: Selecting A cell in a table

Posted: Tue Dec 27, 2022 4:51 pm
by Sergey Tkachenko
In TRichView, horizontal alignment in cell is defined just like in normal document: in paragraph properties.
To center text, its paragraph must have property Alignment = rvaCenter.

You can call
Cell.Clear;
Cell.AddNL('Hello', 0, ParaNo);
where ParaNo is an index (in RVStyle.ParaStyles[]) of item having Alignment = rvaCenter.