How to make the Close button disabled in a windows Form using C# coding

后端 未结 2 642
后悔当初
后悔当初 2021-01-17 02:44

every one. I just want to make the Close button disabled on a button click event using C#.net. I am trying for this but not correctly sure it\'s correct.

  p         


        
2条回答
  •  既然无缘
    2021-01-17 03:19

    private const int dis_close_button = 0x200;
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams ObjCP = base.CreateParams;
                ObjCP.ClassStyle = ObjCP.ClassStyle | dis_close_button;
                return ObjCP;
            }
        }
    

    Try, this...

提交回复
热议问题