trichview.com

trichview.support




Re: Modify cell text


Return to index


Author

Message

Sergey Tkachenko

Posted: 06/22/2005 23:01:25


If this text is the last item in the cell, you can remove it (DeleteItems),

then add two new lines (AddNL and AddNL).

Or modify this text item (set it to "ABC" by SetItemText), and then add

"CDE" (AddNL).


But if you want to do it as an editing operation (which can be undone and

redone), do the following instead:

- set the cell in editing mode (table.EditCell, or cell.Edit)

- set the caret in the proper position

(cell->GetRVData()->SetSelectionBounds)

- editor->InsertText("\r\n");


> Hello, All!

>

> how to _modify_ cell text correctly in program?

> Want to split text in cell into 2 lines (insert \r\n in the middle)

>

> AnsiString new_text = "ABC  \r\n  CDE";

> t->Cells[r][c]->SetItemText(0, new_text);

>

> in this case I've got:  ABC   CDE

>

> if  new_text = "ABC  \\par  CDE";  ->   ABC  \par  CDE

>

>





Powered by ABC Amber Outlook Express Converter