Ma solution:
solution simple est de créer table objet et ajouter des blocs de richtextbox, somothing comme ceci:
var tab = new Table();
var gridLenghtConvertor = new GridLengthConverter();
tab.Columns.Add(new TableColumn() { Name = "colNick", Width = (GridLength)gridLenghtConvertor.ConvertFromString("*") });
tab.Columns.Add(new TableColumn { Name = "colMsg", Width = (GridLength)gridLenghtConvertor.ConvertFromString("5*") });
tab.Columns.Add(new TableColumn() { Name = "colDt", Width = (GridLength)gridLenghtConvertor.ConvertFromString("*") });
tab.RowGroups.Add(new TableRowGroup());
tab.RowGroups[0].Rows.Add(new TableRow());
var tabRow = tab.RowGroups[0].Rows[0];
tabRow.Cells.Add(new TableCell(new Paragraph(new Run(rpMsg.Nick))) { TextAlignment = TextAlignment.Left });
tabRow.Cells.Add(new TableCell(ConvertToRpWithEmoticons(rpMsg.RpText)));
tabRow.Cells.Add(new TableCell(new Paragraph(new Run("Cas"))) { TextAlignment = TextAlignment.Right });
RtbConversation.Document.Blocks.Add(tab);
Pourquoi utilisez-vous un seul RichTextBox (au lieu de trois (Rich) TextBlocks)? – Jens
Je pense que ce n'est pas une bonne solution, par exemple si vous avez plein de richtextbox, vous devez faire défiler 3 richtetbox, aussi vous avez aussi des problèmes avec la hauteur de la ligne dans richtextboxes .... –