Ejemplo n.º 1
0
        /// <summary>
        /// 获取无效时文本颜色
        /// </summary>
        /// <param name="backColor">控件背景色</param>
        /// <returns>无效颜色</returns>
        public static Color GetGrayColor(Color backColor)
        {
            Color controlDark = SystemColors.ControlDark;

            if (RenderEngine.IsDarker(backColor, SystemColors.Control))
            {
                controlDark = ControlPaint.Dark(backColor);
            }
            return(controlDark);
        }