<tfoot id='R5JP6'></tfoot>
    • <bdo id='R5JP6'></bdo><ul id='R5JP6'></ul>

  • <small id='R5JP6'></small><noframes id='R5JP6'>

    <legend id='R5JP6'><style id='R5JP6'><dir id='R5JP6'><q id='R5JP6'></q></dir></style></legend>
      <i id='R5JP6'><tr id='R5JP6'><dt id='R5JP6'><q id='R5JP6'><span id='R5JP6'><b id='R5JP6'><form id='R5JP6'><ins id='R5JP6'></ins><ul id='R5JP6'></ul><sub id='R5JP6'></sub></form><legend id='R5JP6'></legend><bdo id='R5JP6'><pre id='R5JP6'><center id='R5JP6'></center></pre></bdo></b><th id='R5JP6'></th></span></q></dt></tr></i><div id='R5JP6'><tfoot id='R5JP6'></tfoot><dl id='R5JP6'><fieldset id='R5JP6'></fieldset></dl></div>

      1. 修改 RichTextBox 中的默认选项卡大小

        时间:2023-06-04
          <tbody id='Q5xtG'></tbody>

          <bdo id='Q5xtG'></bdo><ul id='Q5xtG'></ul>
          <i id='Q5xtG'><tr id='Q5xtG'><dt id='Q5xtG'><q id='Q5xtG'><span id='Q5xtG'><b id='Q5xtG'><form id='Q5xtG'><ins id='Q5xtG'></ins><ul id='Q5xtG'></ul><sub id='Q5xtG'></sub></form><legend id='Q5xtG'></legend><bdo id='Q5xtG'><pre id='Q5xtG'><center id='Q5xtG'></center></pre></bdo></b><th id='Q5xtG'></th></span></q></dt></tr></i><div id='Q5xtG'><tfoot id='Q5xtG'></tfoot><dl id='Q5xtG'><fieldset id='Q5xtG'></fieldset></dl></div>
        • <small id='Q5xtG'></small><noframes id='Q5xtG'>

          <tfoot id='Q5xtG'></tfoot>
              <legend id='Q5xtG'><style id='Q5xtG'><dir id='Q5xtG'><q id='Q5xtG'></q></dir></style></legend>
                • 本文介绍了修改 RichTextBox 中的默认选项卡大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  有什么方法可以更改 .NET RichTextBox 中的默认选项卡大小?它目前似乎设置为相当于 8 个空格,这对我来说有点大.

                  Is there any way to change the default tab size in a .NET RichTextBox? It currently seems to be set to the equivalent of 8 spaces which is kinda large for my taste.

                  为了澄清,我想将 "的全局默认设置为控件的 4 个空格.据我了解, SelectionTabs 属性要求您首先选择所有文本,然后通过数组选择选项卡宽度.如果必须,我会这样做,但如果可能的话,我宁愿只更改一次全局默认值,这样我就不必每次都这样做.

                  To clarify, I want to set the global default of " " displays as 4 spaces for the control. From what I can understand, the SelectionTabs property requires you to select all the text first and then the the tab widths via the array. I will do this if I have to, but I would rather just change the global default once, if possible, sot that I don't have to do that every time.

                  推荐答案

                  您可以通过设置 SelectionTabs 属性.

                  You can set it by setting the SelectionTabs property.

                  private void Form1_Load(object sender, EventArgs e)
                  {
                      richTextBox1.SelectionTabs = new int[] { 100, 200, 300, 400 };
                  }
                  

                  更新:
                  顺序很重要....

                  UPDATE:
                  The sequence matters....

                  如果您在初始化控件文本之前设置了选项卡,那么您不必在设置选项卡之前选择文本.

                  If you set the tabs prior to the control's text being initialized, then you don't have to select the text prior to setting the tabs.

                  例如,在上面的代码中,这将保留带有原始 8 个空格制表位的文本:

                  For example, in the above code, this will keep the text with the original 8 spaces tab stops:

                  richTextBox1.Text = "	1	2	3	4";
                  richTextBox1.SelectionTabs = new int[] { 100, 200, 300, 400 };
                  

                  但这将使用新的:

                  richTextBox1.SelectionTabs = new int[] { 100, 200, 300, 400 };
                  richTextBox1.Text = "	1	2	3	4";
                  

                  这篇关于修改 RichTextBox 中的默认选项卡大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何使用 C# 启动具有特定 URL 的 Google Chrome 选项 下一篇:如何添加和删除“自定义"C# 中的选项卡

                  相关文章

                  最新文章

                  <small id='upmiN'></small><noframes id='upmiN'>

                  • <bdo id='upmiN'></bdo><ul id='upmiN'></ul>
                • <legend id='upmiN'><style id='upmiN'><dir id='upmiN'><q id='upmiN'></q></dir></style></legend>

                    <i id='upmiN'><tr id='upmiN'><dt id='upmiN'><q id='upmiN'><span id='upmiN'><b id='upmiN'><form id='upmiN'><ins id='upmiN'></ins><ul id='upmiN'></ul><sub id='upmiN'></sub></form><legend id='upmiN'></legend><bdo id='upmiN'><pre id='upmiN'><center id='upmiN'></center></pre></bdo></b><th id='upmiN'></th></span></q></dt></tr></i><div id='upmiN'><tfoot id='upmiN'></tfoot><dl id='upmiN'><fieldset id='upmiN'></fieldset></dl></div>

                    1. <tfoot id='upmiN'></tfoot>