TextCell and TTextBlock

Hi All,

I have tried to understand how TextCell and Textblock works? But the documentation doesen't say much
about this.

Is there any good example with source code describing how to use the TextBlock and TextCell objects
from code?

What I do want to do to is easy, just put out name in one row and description on the same row but in the next cell
to the right. Exactly as an excel sheet with two columns.

Here is what I have done so far:
procedure TForm1.atDiagram1InsertDControl(Sender: TObject; ADControl: TDiagramControl);
var
 s: string;
begin
  if ADControl is TTextBlock then
  begin
     s := Inputbox('Ange Text', 'Ange text till objektet', '');
     (ADControl as TTextBlock).TextCells.Add;
     (ADControl as TTextBlock).TextCells.Add;
     (ADControl as TTextBlock).TextCells.Items[0].Text := 'Row1';
     (ADControl as TTextBlock).TextCells.Items[1].Text := 'Row2';
   end;
end;

In the code example above the row2 text will appear outside the object on top to the left.

Thanks in advance!

Best Regards,
Marco.



In the Newsgroup on 19 July 2012 I posted a reply to my own question there, with subject "Text appearing outside a block".
I had a similar problem when I moved to 4.2.0.0
Text in a block sometimes appears either overlaying the previous line or outside the object on top to the left.
The solution is to set the property Clip = True
Regards,
  Peter Evans

Thanks! I will try that!

Regards,
Marco Eberhardt.