示例#1
0
        internal static Color DisabledTextColor(Color backColor)
        {
            Color controlDark = SystemColors.ControlDark;

            if (ControlPaint.IsDarker(backColor, SystemColors.Control))
            {
                controlDark = ControlPaint.Dark(backColor);
            }
            return(controlDark);
        }
示例#2
0
        internal static Color DisabledTextColor(Color backColor)
        {
            //Theme specs -- if the backcolor is darker than Control, we use
            // ControlPaint.Dark(backcolor).  Otherwise we use ControlDark.
            // see VS#357226
            Color disabledTextForeColor = SystemColors.ControlDark;

            if (ControlPaint.IsDarker(backColor, SystemColors.Control))
            {
                disabledTextForeColor = ControlPaint.Dark(backColor);
            }
            return(disabledTextForeColor);
        }
示例#3
0
        internal static Color DisabledTextColor(Color backColor)
        {
            if (SystemInformation.HighContrast)
            {
                return(SystemColors.GrayText);
            }

            // If the color is darker than SystemColors.Control make it slightly darker,
            // otherwise use the standard control dark color.

            return(ControlPaint.IsDarker(backColor, SystemColors.Control)
                ? ControlPaint.Dark(backColor)
                : SystemColors.ControlDark);
        }
示例#4
0
        internal static Color DisabledTextColor(Color backColor)
        {
            if (SystemInformation.HighContrast)
            {
                return(SystemColors.GrayText);
            }

            //Theme specs -- if the backcolor is darker than Control, we use
            // ControlPaint.Dark(backcolor).  Otherwise we use ControlDark.
            Color disabledTextForeColor = SystemColors.ControlDark;

            if (ControlPaint.IsDarker(backColor, SystemColors.Control))
            {
                disabledTextForeColor = ControlPaint.Dark(backColor);
            }
            return(disabledTextForeColor);
        }
示例#5
0
        internal static Color DisabledTextColor(Color backColor)
        {
            if (SystemInformation.HighContrast && AccessibilityImprovements.Level1)
            {
                return(SystemColors.GrayText);
            }

            //Theme specs -- if the backcolor is darker than Control, we use
            // ControlPaint.Dark(backcolor).  Otherwise we use ControlDark.
            // see VS#357226
            Color disabledTextForeColor = SystemColors.ControlDark;

            if (ControlPaint.IsDarker(backColor, SystemColors.Control))
            {
                disabledTextForeColor = ControlPaint.Dark(backColor);
            }
            return(disabledTextForeColor);
        }
示例#6
0
        internal static Color DisabledTextColor(Color backColor)
        {
            if (SystemInformation.HighContrast && !LocalAppContextSwitches.UseLegacyAccessibilityFeatures)
            {
                return(SystemColors.GrayText);
            }

            //Theme specs -- if the backcolor is darker than Control, we use
            // ControlPaint.Dark(backcolor).  Otherwise we use ControlDark.
            // see VS#357226
            Color disabledTextForeColor = SystemColors.ControlDark;

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