10854 : Ive got a problem with the AddText of the TextCollection in VCL.

Question

I’ve got a problem with the ‘AddText’ of the ‘TextCollection’.

For exemple after an ‘AddText’ method when i test the ‘TextCollection.Count’ it’s said 0.
I don’t know how to change the text of my ‘TphDataEntity_GantTime’ after i create it.

Answer

The code below adds a text to a time item, and then changes it…

procedure TForm1.Button4Click(Sender: TObject);
begin
  if Assigned(phGant1.ActiveDataEntity) then
  begin
    phGant1.ActiveDataEntity.TextCollection.AddText(‘Hello’,0,0);
    ShowMessage(IntToStr(phGant1.ActiveDataEntity.TextCollection.Count));
    phGant1.ActiveDataEntity.TextCollection.Text[0].Text:=phGant1.ActiveDataEntity.TextCollection.Text[0].Text+’+’;
  end;
end;

Leave a Reply