microsoft-ui-xaml icon indicating copy to clipboard operation
microsoft-ui-xaml copied to clipboard

Proposal: support keyboard shortcuts to expand/collapse children in TreeView

Open chausner opened this issue 1 year ago • 1 comments

Proposal: support keyboard shortcuts to expand/collapse children in TreeView

Summary

Add support to the TreeView control to expand/recursively expand/collaps the selected node when the +/*/- keys are pressed.

Rationale

The TreeView controls in WPF (and probably also WinForms/Win32) allow the following keyboard shortcuts when an item is selected in a TreeView:

  • plus key: expand selected node
  • asterisk key: recursively expand all child nodes
  • minus key: collapse selected node

These shortcuts have been in use for a long time and supported across applications. It would be desirable that WinUI continues to support them. Especially the shortcut to recursively expand nodes is sometimes very useful because it is not available via the mouse or touch (as far as I know).

chausner avatar Aug 26 '24 21:08 chausner

UX regressions from win32 seem like a very low priority for the team, so don't hold your breath 😅 ref: #8953

Permik avatar Aug 28 '24 19:08 Permik

asterisk key: recursively expand all child nodes

Today I learned that one could press "*" in File Explorer and expand the whole subtree! 😲

Image

fdwr avatar Oct 02 '25 00:10 fdwr

Today I learned that one could press "*" in File Explorer and expand the whole subtree! 😲

It is documented in MSDN for Win32 Tree View : https://learn.microsoft.com/en-us/previous-versions/windows/desktop/dnacc/guidelines-for-keyboard-user-interface-design#windows-shortcut-keys

castorix avatar Oct 02 '25 06:10 castorix