我正在构建一个要在Richtextbox中显示的段落。 但是我注意到当段落文本是[或(或{,它从一个新行开始。
我键入的示例
测试{
并在Richtext框中显示以下内容:
Testing
{
CODE:
public Paragraph MakeItem1(string text, string firstmsg)
{
Paragraph item = new Paragraph();
if (firstmsg != "")
{
Run run11 = new Run(firstmsg);
run11.BaselineAlignment = BaselineAlignment.Top;
item.Inlines.Add(new Bold(run11));
}
//THE TEXT CONTAINING THE {([ is in the string text
Run run1 = new Run(text);
run1.BaselineAlignment = BaselineAlignment.Top;
item.Inlines.Add(run1);
Line pLine = new Line();
pLine.Stretch = Stretch.Fill;
pLine.Margin = new Thickness(0, 7, 0, 7);
pLine.Stroke = Brushes.Gray;
pLine.X2 = 1;
item.Inlines.Add(pLine);
return item;
}
有谁知道为什么我只为这些角色得到这种行为?