Skip to content
Open
Changes from 3 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 @@ -578,10 +578,18 @@ private void ListBox_drawItem(object? sender, DrawItemEventArgs e)

Color backColor = SystemColors.Window;
Color textColor = SystemColors.WindowText;

using (SolidBrush backBrush = new(backColor))
{
g.FillRectangle(backBrush, button);
}

if ((e.State & DrawItemState.Selected) == DrawItemState.Selected)
{
backColor = SystemColors.Highlight;
textColor = SystemColors.HighlightText;
#pragma warning disable WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
textColor = Application.IsDarkModeEnabled ? SystemColors.ControlText : SystemColors.HighlightText;
#pragma warning restore WFO5001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
}

Rectangle res = e.Bounds with { X = e.Bounds.X + offset, Width = e.Bounds.Width - offset };
Expand Down
Loading