【问题标题】:how to create a form without max/min/close button in c#?如何在 C# 中创建没有最大/最小/关闭按钮的表单?
【发布时间】:2010-12-23 04:22:51
【问题描述】:

我知道 P/invoke 可以做到,但是有托管方式吗?

【问题讨论】:

    标签: winforms button


    【解决方案1】:

    您应该能够切换ControlBox 属性。

    public void CreateMyBorderlessWindow()
     {
        this.FormBorderStyle = FormBorderStyle.None;
        this.MaximizeBox = false;
        this.MinimizeBox = false;
        this.StartPosition = FormStartPosition.CenterScreen;
        // Remove the control box so the form will only display client area.
        this.ControlBox = false;
     }
    

    【讨论】:

      【解决方案2】:

      是的...只需禁用表单属性上的控制框即可。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2022-11-11
        • 2020-10-24
        • 2016-04-20
        • 2016-05-17
        • 1970-01-01
        • 2013-04-17
        • 1970-01-01
        相关资源
        最近更新 更多