• C# Form 关闭按钮灰化


     

    可以通过调用API函数将关闭按钮灰化(不可用)

            [DllImport("user32")]
            public static extern IntPtr GetSystemMenu(IntPtr hwnd, int bRevert);

            [DllImport("user32")]
            public static extern int RemoveMenu(IntPtr hMenu, int nPosition, int wFlags);

            public const int MF_BYPOSITION = 0x400;

    然后在窗体load事件里加入下面代码
                IntPtr close = GetSystemMenu(this.Handle, 0);
                RemoveMenu(close, 6, MF_BYPOSITION);
    这样就能将关闭按钮灰化了。

  • 相关阅读:
    hdu 5101 Select
    hdu 5100 Chessboard
    cf B. I.O.U.
    cf C. Inna and Dima
    cf B. Inna and Nine
    cf C. Counting Kangaroos is Fun
    Radar Installation 贪心
    spfa模板
    Sequence
    棋盘问题
  • 原文地址:https://www.cnblogs.com/renfeng/p/3727838.html
Copyright © 2020-2023  润新知