Skip to content

[Dark Mode] Improve visual contrast of the Group Headers in ListView control in dark #14198

@uom42

Description

@uom42

.NET version

.NET version
9 / 10

Did it work in .NET Framework?

No

Issue description

This is a new feature Dark Mode

Issue description
The Group Headers in ListView control is not clear in the DarkMode[Dark Mode]
Improve visual contrast of the Group Headers

Image

Steps to reproduce

Create a WinForms .NET Core application with ListView control.
Enable DarkMode by Application.SetColorMode(SystemColorMode.Dark) in Program.cs file.
Add Groups and Items to the ListView control.
Run the application.

Sample code:

namespace ListViewDarkModeDemo;

internal static class Program
{
    [STAThread]
    static void Main ()
    {
        ApplicationConfiguration.Initialize();
        Application.SetColorMode(SystemColorMode.System);

        ListView lvwTest = new() { Dock = DockStyle.Fill , View = View.Details };
        lvwTest.Columns.Add("Column 1");

        ListViewGroup lvg = null;
        for ( int i = 0 ; i < 7 ; i++ )
        {
            if ( i < 3 )
            {
                lvg = new($"Group for item {i}")
                {
                    CollapsedState = i == 1 ? ListViewGroupCollapsedState.Expanded : ListViewGroupCollapsedState.Collapsed ,
                    Footer = $"Footer of group {i}" ,
                    Subtitle = $"Subtitle of group {i}"
                };
                lvwTest.Groups.Add(lvg);
            }

            ListViewItem lvi = new($"Item {i}") { Group = lvg! };
            lvwTest.Items.Add(lvi);
        }
        lvwTest.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);

        Form mainForm = new() { Text = "Dark Mode Test" , Size = new(800 , 600) , StartPosition = FormStartPosition.CenterScreen };
        mainForm.Controls.Add(lvwTest);

        Application.Run(mainForm);
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-DarkModeIssues relating to Dark Mode featureuntriagedThe team needs to look at this issue in the next triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions