none
wpf richtextbox 中如何插入表格 RRS feed

答案

  • 由于你只能在FlowDocument中使用Table,因此你可以以下面的形式将Table加入到RichTextbox中,

    <RichTextBox>

        <FlowDocument>

            <Table BorderBrush="Black" BorderThickness="1">

                <Table.Columns>

                    <TableColumn Width="25"/>

                    <TableColumn/>

                </Table.Columns>

                <TableRowGroup>

                    <TableRow>

                        <TableCell>

                            <Paragraph>&#x2665;</Paragraph>

                        </TableCell>

                        <TableCell>

                            <Paragraph>Raspberry</Paragraph>

                        </TableCell>

                    </TableRow>

                    <TableRow>

                        <TableCell>

                            <Paragraph>&#x2665;</Paragraph>

                        </TableCell>

                        <TableCell>

                            <Paragraph>Vanilla</Paragraph>

                        </TableCell>

                    </TableRow>

                </TableRowGroup>

            </Table>

        </FlowDocument>

    </RichTextBox>

     

    Best regards,


    Sheldon _Xiao [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • 已建议为答案 Jarrey 2011年3月1日 6:08
    • 已标记为答案 zhengkk 2011年3月1日 6:59
    2011年3月1日 6:07
    版主