Skip to content

Enable dark mode for TreeView and ListView mouse tooltips - #14889

Merged
KlausLoeffelmann merged 2 commits into
dotnet:mainfrom
LeafShi1:Fix_14878_TreeView_and_ListView_mouse_tooltips_color_issue
Aug 14, 2026
Merged

KlausLoeffelmann merged 2 commits into
dotnet:mainfrom
LeafShi1:Fix_14878_TreeView_and_ListView_mouse_tooltips_color_issue

Conversation

@LeafShi1

@LeafShi1 LeafShi1 commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Fixes #14878

Root Cause

TreeView and ListView use native tooltip windows for mouse-hover tooltips. Dark mode was applied to the controls themselves and to managed keyboard tooltips, but not to these native tooltip windows.

Proposed changes

  • Retrieve the native tooltip handles using TVM_GETTOOLTIPS and LVM_GETTOOLTIPS, then apply the DarkMode_Explorer theme when dark mode is enabled for the control.

Customer Impact

  • Applications using TreeView or ListView in dark mode now provide visually consistent tooltips.

Regression?

  • No

Risk

  • Minimal

Screenshots

Before

With SystemColorMode.Dark enabled, mouse-hover tooltips for TreeView and ListView were rendered using the light theme. Keyboard tooltips were already rendered in dark mode.

Image

After

Mouse-hover and keyboard tooltips for TreeView and ListView are consistently rendered in dark mode when SystemColorMode.Dark is enabled.

image image

Test methodology

  • Manually

Test environment(s)

  • .net 11.0.0-rc.1.26411.119
Microsoft Reviewers: Open in CodeFlow

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables dark-mode theming for the native (mouse-hover) tooltip windows used by TreeView and ListView, aligning their appearance with existing dark-mode support for the controls and managed keyboard tooltips.

Changes:

  • TreeView: retrieves the native tooltip HWND via TVM_GETTOOLTIPS and applies the DarkMode_Explorer theme when dark mode is enabled.
  • ListView: retrieves the native tooltip HWND via LVM_GETTOOLTIPS and applies the DarkMode_Explorer theme when dark mode is enabled.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/System.Windows.Forms/System/Windows/Forms/Controls/TreeView/TreeView.cs Applies dark-mode theme to the TreeView native tooltip handle during handle creation.
src/System.Windows.Forms/System/Windows/Forms/Controls/ListView/ListView.cs Applies dark-mode theme to the ListView native tooltip handle during on-demand dark mode application.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@KlausLoeffelmann

Copy link
Copy Markdown
Member

@LeafShi1 , can you address or ignore/resolve the copilot comments?
This is otherwise good to go!

@LeafShi1 LeafShi1 added the waiting-review This item is waiting on review by one or more members of team label Aug 14, 2026
@LeafShi1

Copy link
Copy Markdown
Member Author

@LeafShi1 , can you address or ignore/resolve the copilot comments? This is otherwise good to go!

Done!

@KlausLoeffelmann KlausLoeffelmann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@KlausLoeffelmann
KlausLoeffelmann merged commit 3c3fc01 into dotnet:main Aug 14, 2026
8 checks passed
@dotnet-policy-service dotnet-policy-service Bot removed the waiting-review This item is waiting on review by one or more members of team label Aug 14, 2026
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 15, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dark Mode] The mouse ToolTip is not in dark mode for TreeView & ListView controls after enabled SystemColorMode.Dark

3 participants