4

我正在尝试在 FlowDocument 中显示一个列表。我意识到在使用时 MarkerStyle = TextMarkerStyle.Disc,列表的缩进比其他列表少。我正在寻找一种方法来显示带有光盘标记的列表,但与其他标记相同的缩进,有什么提示吗?

这是一个显示我的问题的片段:

        List l = new List();
        l.MarkerStyle = TextMarkerStyle.Disc;    
        l.ListItems.Add(new ListItem(new Paragraph(new Run("cxyc"))));
        l.ListItems.Add(new ListItem(new Paragraph(new Run("asdasd"))));
        l.ListItems.Add(new ListItem(new Paragraph(new Run("ghjtd"))));
        richTextBox.Document.Blocks.Add(l);


        l = new List();
        l.MarkerStyle = TextMarkerStyle.Decimal;
        l.ListItems.Add(new ListItem(new Paragraph(new Run("$!"))));
        l.ListItems.Add(new ListItem(new Paragraph(new Run("&!§"))));
        l.ListItems.Add(new ListItem(new Paragraph(new Run("&!"))));
        richTextBox.Document.Blocks.Add(l);

        l = new List();
        l.MarkerStyle = TextMarkerStyle.LowerLatin;
        l.ListItems.Add(new ListItem(new Paragraph(new Run("16123"))));
        l.ListItems.Add(new ListItem(new Paragraph(new Run("gasd"))));
        l.ListItems.Add(new ListItem(new Paragraph(new Run("612312"))));
        richTextBox.Document.Blocks.Add(l);

        l = new List();
        l.MarkerStyle = TextMarkerStyle.None;
        l.ListItems.Add(new ListItem(new Paragraph(new Run("15123"))));
        l.ListItems.Add(new ListItem(new Paragraph(new Run("fasdas"))));
        l.ListItems.Add(new ListItem(new Paragraph(new Run("5161234"))));
        richTextBox.Document.Blocks.Add(l);
4

1 回答 1

3

将列表上的填充设置为具有显式的左侧填充。四个方向默认为 Auto (NaN),当为 Auto 时,List 会根据 MarkerStyle 设置左内边距。

l.Padding = new Thickness(20, double.NaN, double.NaN, double.NaN);
于 2010-06-29T13:01:38.827 回答