Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ private static Color GetBorderColor(ComboBox comboBox, bool useAccent)

return useAccent
? Application.SystemVisualSettings.AccentColor
: comboBox.ForeColor;
: ModernControlColorMath.TextControlBorderColor;
}

private static int GetBorderThickness(ComboBox comboBox)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2663,10 +2663,9 @@ private protected virtual void OnNcPaint(Graphics graphics, HDC windowHdc)
int borderThickness = Math.Max(focusBorderMetrics.Width, focusBorderMetrics.Height);
int focusBandHeight = GetVisualStylesFocusBandHeight();

Color adornerColor = ForeColor;

Color clientBackColor = BackColor;
Color parentBackColor = Parent?.BackColor ?? BackColor;
Color adornerColor = ModernControlColorMath.TextControlBorderColor;

using var clientBackgroundBrush = clientBackColor.GetCachedSolidBrushScope();
using var adornerBrush = adornerColor.GetCachedSolidBrushScope();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1084,10 +1084,9 @@ private void DrawModernBorder(PaintEventArgs e)
int cornerRadius = LogicalToDeviceUnits(ModernControlVisualStyles.UpDownCornerRadius);
int borderThickness = LogicalToDeviceUnits(ModernControlVisualStyles.BorderThickness);

// The adorner (border) color matches the modern TextBox chrome, which uses the fore color.
Color adornerColor = ForeColor;
Color parentBackColor = Parent?.BackColor ?? BackColor;
Color clientBackColor = BackColor;
Color adornerColor = ModernControlColorMath.TextControlBorderColor;

using var clientBackgroundBrush = clientBackColor.GetCachedSolidBrushScope();
using var adornerPen = adornerColor.GetCachedPenScope(borderThickness);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ internal static class ModernControlColorMath
private static readonly Color s_darkModeDisabledForeground = Color.FromArgb(0x88, 0x88, 0x88);
private static readonly Color s_lightModeDisabledForeground = Color.FromArgb(0xA0, 0xA0, 0xA0);

internal static Color TextControlBorderColor => SystemColors.ControlDarkDark;

/// <summary>
/// Gets the surface color for a disabled modern control, honoring the current color mode
/// and high contrast settings.
Expand Down
Loading