簡體   English   中英

WPF通過代碼將段落添加到TableCell

[英]WPF add Paragraph into TableCell by code

如何通過代碼將兩個Paragraph添加到TableCell 在XAML中,

<TableCell>
    <Paragraph>first</Paragraph>
    <Paragraph>second</Paragraph>
</TableCell>

在代碼中,我可以這樣

TableCell firstCell = new TableCell(new Paragraph(new Run("first")));

嘗試添加到TableCell的

看看MSDN TableCell.Blocks

理想情況下,它看起來像這樣

//I did not test this code
TableCell firstCell = new TableCell();
firstCell.Blocks.Add(new Paragraph(new Run("first")));

希望對您有所幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM