我有一个表单,用户在游戏开始时用来选择关卡。我想禁用关闭按钮,以便用户无法关闭表单(用户将单击一些按钮来选择级别)。
如果未使用单击按钮,我已经能够阻止用户关闭表单
    bool _Next = false;
    public Form1()
    {
        InitializeComponent();
        button1.Click += new EventHandler(button_Click);
        button2.Click += new EventHandler(button_Click);
        button3.Click += new EventHandler(button_Click);
    }
    void button_Click(object sender, EventArgs e)
    {
        Button btn = (Button)sender;
        if (btn == button1)
        {
            Level(1);
        }
        else if (btn == button2)
        {
            Level(2);
        }
        else if (btn == button3)
        {
            Level(3);
        }
        _Next = true;
    }
    private void Form1_FormClosing(object sender, FormClosingEventArgs e)
    {
        if (_Next == true)
        {
        }
        else
        {
            e.Cancel = true;
        }
    }
这是相当长的。我想知道是否有任何方法可以禁用或隐藏表单关闭按钮