Summary
While checking Klaus' report that TreeView.FullRowSelect "does not work anymore", I could not find a TreeView code regression on either origin/main or origin/VisualStylesNet11.
Current best diagnosis: this is most likely the long-standing native TreeView constraint that FullRowSelect has no visual effect when ShowLines is true (which is the WinForms default), not a new regression.
Repro snippet
using System.Windows.Forms;
Application.EnableVisualStyles();
Application.Run(new Form
{
Controls =
{
new TreeView
{
Dock = DockStyle.Fill,
FullRowSelect = true,
HideSelection = false,
// ShowLines stays at its default: true
Nodes =
{
new TreeNode("Root")
{
Nodes = { new TreeNode("Child") }
}
}
}
}
});
Actual behavior
With the default ShowLines = true, the selection highlight does not appear to span the full row, which makes FullRowSelect look broken.
Expected behavior
Either:
- the control should make it much clearer that
FullRowSelect is ineffective while ShowLines is enabled, or
- if we believe the current behavior is too surprising, we should decide whether to add a dedicated regression/integration test and/or improve docs / sample coverage.
Investigation findings
origin/main
I verified that the managed wrapper still applies the expected native style:
TreeView.CreateParams still ORs TVS_FULLROWSELECT when FullRowSelect is true.
- The
FullRowSelect property documentation in TreeView.cs still explicitly says: "This property will have no effect if ShowLines is true."
- Existing unit tests for the current code path passed locally, including:
TreeView_CreateParams_GetFullRowSelect_ReturnsExpected
FullRowSelect_SetWithHandle_GetReturnsExpected
FullRowSelect_SetWithUpdateStylesHandlerWithHandle_CallsStyleChangedCallsInvalidated
So on plain main, I could confirm the style wiring is still present; I did not find evidence that the FullRowSelect implementation itself regressed.
origin/VisualStylesNet11
I compared origin/main and origin/VisualStylesNet11 read-only.
- There are no
TreeView file changes between those branches under src/System.Windows.Forms/System/Windows/Forms/Controls/TreeView/.
- The branch changes are concentrated in
Control.cs, VisualStylesMode.cs, Button*, and TextBoxBase* work.
So I could not attribute the report to a TreeView-specific change on VisualStylesNet11.
Best current diagnosis (hypothesis)
This looks like a configuration / expectation trap, not a new branch regression:
FullRowSelect is set,
- but
ShowLines remains true (default),
- and the native control therefore does not visually show full-row selection.
If Klaus' repro app left ShowLines at its default, that would explain the observation on both main and VisualStylesNet11.
Suggested follow-up
- Re-run the visual repro with
ShowLines = false explicitly set.
- If the problem still reproduces with
ShowLines = false, capture that exact repro separately, because that would point to a different issue than the one I could verify from source/tests.
Summary
While checking Klaus' report that
TreeView.FullRowSelect"does not work anymore", I could not find aTreeViewcode regression on eitherorigin/mainororigin/VisualStylesNet11.Current best diagnosis: this is most likely the long-standing native
TreeViewconstraint thatFullRowSelecthas no visual effect whenShowLinesistrue(which is the WinForms default), not a new regression.Repro snippet
Actual behavior
With the default
ShowLines = true, the selection highlight does not appear to span the full row, which makesFullRowSelectlook broken.Expected behavior
Either:
FullRowSelectis ineffective whileShowLinesis enabled, orInvestigation findings
origin/mainI verified that the managed wrapper still applies the expected native style:
TreeView.CreateParamsstill ORsTVS_FULLROWSELECTwhenFullRowSelectistrue.FullRowSelectproperty documentation inTreeView.csstill explicitly says: "This property will have no effect if ShowLines is true."TreeView_CreateParams_GetFullRowSelect_ReturnsExpectedFullRowSelect_SetWithHandle_GetReturnsExpectedFullRowSelect_SetWithUpdateStylesHandlerWithHandle_CallsStyleChangedCallsInvalidatedSo on plain
main, I could confirm the style wiring is still present; I did not find evidence that theFullRowSelectimplementation itself regressed.origin/VisualStylesNet11I compared
origin/mainandorigin/VisualStylesNet11read-only.TreeViewfile changes between those branches undersrc/System.Windows.Forms/System/Windows/Forms/Controls/TreeView/.Control.cs,VisualStylesMode.cs,Button*, andTextBoxBase*work.So I could not attribute the report to a TreeView-specific change on
VisualStylesNet11.Best current diagnosis (hypothesis)
This looks like a configuration / expectation trap, not a new branch regression:
FullRowSelectis set,ShowLinesremainstrue(default),If Klaus' repro app left
ShowLinesat its default, that would explain the observation on bothmainandVisualStylesNet11.Suggested follow-up
ShowLines = falseexplicitly set.ShowLines = false, capture that exact repro separately, because that would point to a different issue than the one I could verify from source/tests.