<bdo id='tmMvO'></bdo><ul id='tmMvO'></ul>
    1. <small id='tmMvO'></small><noframes id='tmMvO'>

      <tfoot id='tmMvO'></tfoot>
      <legend id='tmMvO'><style id='tmMvO'><dir id='tmMvO'><q id='tmMvO'></q></dir></style></legend>

      1. <i id='tmMvO'><tr id='tmMvO'><dt id='tmMvO'><q id='tmMvO'><span id='tmMvO'><b id='tmMvO'><form id='tmMvO'><ins id='tmMvO'></ins><ul id='tmMvO'></ul><sub id='tmMvO'></sub></form><legend id='tmMvO'></legend><bdo id='tmMvO'><pre id='tmMvO'><center id='tmMvO'></center></pre></bdo></b><th id='tmMvO'></th></span></q></dt></tr></i><div id='tmMvO'><tfoot id='tmMvO'></tfoot><dl id='tmMvO'><fieldset id='tmMvO'></fieldset></dl></div>
      2. 如何创建一个有边框但没有标题栏的表单?(如 Windows 7 上的音量控制)

        时间:2023-10-24
          <legend id='Pyzu6'><style id='Pyzu6'><dir id='Pyzu6'><q id='Pyzu6'></q></dir></style></legend>
            <tbody id='Pyzu6'></tbody>
          • <bdo id='Pyzu6'></bdo><ul id='Pyzu6'></ul>

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

                1. <small id='Pyzu6'></small><noframes id='Pyzu6'>

                2. 本文介绍了如何创建一个有边框但没有标题栏的表单?(如 Windows 7 上的音量控制)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 Windows 7 中,音量混合器窗口具有特定的样式,具有厚实、透明的边框,但没有标题栏.如何在 winforms 窗口中重新创建该窗口样式?

                  In Windows 7, the volume mixer windows has a specific style, with a thick, transparent border, but no title bar. How do i recreate that window style in a winforms window?

                  我尝试将 Text 设置为 string.Empty,将 ControlBox 设置为 false,这会删除标题栏,但随后边框也会消失:

                  I tried setting Text to string.Empty, and ControlBox to false, which removes the titlebar, but then the border also disappears:

                  推荐答案

                  form.Text = string.Empty;
                  form.ControlBox = false;
                  form.FormBorderStyle = FormBorderStyle.SizableToolWindow;
                  

                  对于固定大小的窗口,您仍应使用 FormBorderStyle.SizableToolWindow,但您可以覆盖表单的 WndProc 以忽略非客户端命中测试(用于切换到尺寸光标):

                  For a fixed size window, you should still use FormBorderStyle.SizableToolWindow, but you can override the form's WndProc to ignore non-client hit tests (which are used to switch to the sizing cursors):

                  protected override void WndProc(ref Message message)
                  {
                      const int WM_NCHITTEST = 0x0084;
                  
                      if (message.Msg == WM_NCHITTEST)
                          return;
                  
                      base.WndProc(ref message);
                  }
                  

                  如果您想真正强制执行大小,您还可以在表单上设置 MinimumSize 等于 MaximumSize.

                  If you want to really enforce the size, you could also set MinimumSize equal to MaximumSize on the form.

                  这篇关于如何创建一个有边框但没有标题栏的表单?(如 Windows 7 上的音量控制)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:C# 设置屏幕亮度 Windows 7 下一篇:Screen.AllScreen 没有给出正确的监视器计数

                  相关文章

                  • <bdo id='qz9oh'></bdo><ul id='qz9oh'></ul>

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

                    <tfoot id='qz9oh'></tfoot>
                    <legend id='qz9oh'><style id='qz9oh'><dir id='qz9oh'><q id='qz9oh'></q></dir></style></legend>

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