ure*_*ema 3 c# wpf flowdocument
我试过这个......
_doc = new FlowDocument();
Table t = new Table();
for (int i = 0; i < 7; i++)
{
t.Columns.Add(new TableColumn());
}
TableRow row = new TableRow();
row.Background = Brushes.Silver;
row.FontSize = 40;
row.FontWeight = FontWeights.Bold;
row.Cells.Add(new TableCell(new Paragraph(new Run("I span 7 columns"))));
row.Cells[0].ColumnSpan = 6;
_doc2.Blocks.Add(t);
Run Code Online (Sandbox Code Playgroud)
当我去查看此文档时,表格永远不会显示.....虽然我在添加此表格之前添加到此文档的边框图像和文档标题输出正常.
您将列添加到表中,但添加行的代码在哪里?它只是没有连接.
添加如下内容:
...
var rg = new TableRowGroup();
rg.Rows.Add(row);
t.RowGroups.Add(rg);
_doc2.Blocks.Add(t);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7760 次 |
| 最近记录: |