trichview.com

trichview.support




Re: Modify cell text


Return to index


Author

Message

Alexander Fatykhov

Posted: 06/23/2005 9:45:27


Hello, All!


ST> If this text is the last item in the cell, you can remove it

ST> (DeleteItems), then add two new lines (AddNL and AddNL).

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

ST> "CDE" (AddNL).


that's it! thnx.



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

ST> and redone), do the following instead:

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

ST> - set the caret in the proper position

ST> (cell->GetRVData()->SetSelectionBounds)

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


ST>> Hello, All!

ST>>

ST>> how to _modify_ cell text correctly in program?

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

ST>>

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

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

ST>>

ST>> in this case I've got:  ABC   CDE

ST>>

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

ST>>

ST>>





Powered by ABC Amber Outlook Express Converter