是否可以在 c# 中的 RTB 中设置每行的悬挂缩进?

发布于 2024-11-06 03:51:59 字数 594 浏览 4 评论 0原文

因此,基本上我需要在 C Sharp 富文本框中执行的操作是从该图像中的外观中获取文本:

并使其看起来像堆栈溢出一样完美格式化:

  1. 产品数据:
    1. 根据规格提交制造商印刷的产品文献、规格和数据表。
  2. 测试报告及证书:
    1. 测试报告:提交一份测试计划草案和报告以供审核,包括:
      1. 系统和设备测试程序。
      2. 测试清单。
      3. 每个视频通道录制的视频,包括显示录制速率、分辨率和压缩格式的元数据。
    2. 证书:提交由制造商签署的证书,证明材料符合指定的性能特征和物理特性。
      1. 提交 ULC/UL 产品安全证书。

我尝试过使用 rtb.sethangingIndent 方法,但这只是同时将其设置为整个文本框

正如我确信您可以看到的,文本需要缩进不同的级别,具体取决于您所在的级别都在,我认为这让事情很混乱!

有没有一种方法可以做到这一点,而无需循环遍历文本框的每一行,并计算“块”顶行之前的空白量(需要缩进)?

So basically what I need to do in a C sharp rich text box, is take the text from how it looks in this image:

How the text looks now

And make it look perfectly formatted like stack overflow does:

  1. Product Data:
    1. Submit manufacturers printed product literature, specifications and datasheet in accordance with specifications.
  2. Test Reports & Certificates:
    1. Test Reports: Submit one draft of test plan and report for review including:
      1. Procedures for system and equipment testing.
      2. Testing checklist.
      3. Recorded video from each channel of video including metadata which shows record rate, resolution and compression format.
    2. Certificates: Submit certificates signed by manufacturer certifying that materials comply with specified performance characteristics and physical properties.
      1. Submit ULC/UL Product Safety Certificates.

I have tried playing with the rtb.sethangingIndent method, but that just sets it for the ENTIRE textbox at the same time

As I am sure you can see, There are different levels that the text needs to be indented by, depending on which level you are at, which I think confuses things a lot!

Is there a way to do this without looping through each line of the textbox, and counting the amount of whitespace before the top line of "block" (that would need to be indented)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沦落红尘 2024-11-13 03:51:59

如果您手动编写此内容,请尝试使用不同的段落。

1、产品数据:
1.按照规范提交制造商印刷的产品文献、规格和数据表

如果你想通过代码来调整它。尝试文本指针。 - http://msdn.microsoft.com/en-我们/library/system.windows.documents.textpointer.aspx

If you manually write this, try to use different paragraphs.

1. Product Data:
1. Submit manufacturers printed product literature, specifications and datasheet in accordance with specifications

If you want to adjust it by code. Try TextPointer. - http://msdn.microsoft.com/en-us/library/system.windows.documents.textpointer.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文