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

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

    <bdo id='WtnhU'></bdo><ul id='WtnhU'></ul>

      1. 如何创建没有选项卡标题的 TabControl?

        时间:2023-06-04

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

        • <bdo id='JMdld'></bdo><ul id='JMdld'></ul>
            <tbody id='JMdld'></tbody>

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

                  <legend id='JMdld'><style id='JMdld'><dir id='JMdld'><q id='JMdld'></q></dir></style></legend>
                  本文介绍了如何创建没有选项卡标题的 TabControl?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  如何制作不显示选项卡标题的选项卡管理器?

                  How do I make a tab manager that doesn't show the tab headers?

                  这是一个winforms应用程序,使用标签管理器的目的是为了显示内容只能通过代码来改变.它适用于各种菜单选项更改屏幕内容的菜单.

                  This is a winforms application, and the purpose of using a tab manager is so the display content can only be changed through code. It's good for menus where various menu options change the screen contents.

                  推荐答案

                  在标准 TabControl 上隐藏选项卡非常简单,只要您知道诀窍.向选项卡控件发送 TCM_ADJUSTRECT 消息当它需要调整标签大小时,我们只需要捕获该消息.(我相信这个问题之前已经回答过了,但是发布代码比搜索更容易.)

                  Hiding the tabs on a standard TabControl is pretty simple, once you know the trick. The tab control is sent a TCM_ADJUSTRECT message when it needs to adjust the tab size, so we just need to trap that message. (I'm sure this has been answered before, but posting the code is easier than searching for it.)

                  将以下代码添加到项目中的新类中,重新编译并使用 CustomTabControl 类而不是内置控件:

                  Add the following code to a new class in your project, recompile, and use the CustomTabControl class instead of the built-in control:

                  class CustomTabControl : TabControl
                  {
                      private const int TCM_ADJUSTRECT = 0x1328;
                  
                      protected override void WndProc(ref Message m)
                      {
                          // Hide the tab headers at run-time
                          if (m.Msg == TCM_ADJUSTRECT && !DesignMode)
                          {
                              m.Result = (IntPtr)1;
                              return;
                          }
                  
                          // call the base class implementation
                          base.WndProc(ref m);
                      }
                  }
                  

                  (代码示例最初取自 Dot Net Thoughts.)

                  (Code sample originally taken from Dot Net Thoughts.)

                  请注意,这不适用于位于侧面或底部的标签页眉.但这不仅看起来很奇怪,而且无论如何您都无法在运行时看到选项卡.只需将它们放在它们所属的顶部即可.

                  Note that this will not work properly for tab headers positioned on the sides or the bottom. But not only does that just look weird, you won't be able to see the tabs at run-time anyway. Just put them on the top where they belong.

                  这篇关于如何创建没有选项卡标题的 TabControl?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何添加和删除“自定义"C# 中的选项卡 下一篇:C# 读取包含由制表符分隔的数据的文本文件

                  相关文章

                  最新文章

                  <tfoot id='GUtV6'></tfoot>

                      <bdo id='GUtV6'></bdo><ul id='GUtV6'></ul>
                    <legend id='GUtV6'><style id='GUtV6'><dir id='GUtV6'><q id='GUtV6'></q></dir></style></legend>
                    1. <small id='GUtV6'></small><noframes id='GUtV6'>

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