Take the 2-minute tour ×
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It's 100% free, no registration required.

I've always wondered why Windows controls have their HideSelection property set to true by default?

Example (TreeView): http://msdn.microsoft.com/en-us//library/system.windows.forms.treeview.hideselection%28v=vs.80%29.aspx

MSDN states that for accessibilty it should be set to false.

Is there any reason to hide the selection to the user by default?

share|improve this question
    
+1 This has puzzled me as well. One of the first properties to get changed for any list/tree like control. Don't do it quite as quickly for edit/memo controls though. No idea why. –  Marjan Venema Sep 3 '12 at 11:20
1  
I guess that's just because it's the default in the underlying windows control, TVS_SHOWSELALWAYS / LVS_SHOWSELALWAYS are explicit style flags you have to set. They inherit their default state probably from the ES_NOHIDESEL of the edit control, where this default arguably is the better choice. Incidentally, ListBox didn't have such an option at all, it would always show selection which couldn't be disabled. (except LBS_NOSEL style which prevents any selection at all) –  peterchen Sep 4 '12 at 8:17
    
re - acessibility: does screen reader treat it differently maybe? –  peterchen Sep 4 '12 at 8:19
add comment

1 Answer

From your link on the TreeView (MSDN)

Gets or sets a value indicating whether the selected tree node remains highlighted even when the tree view has lost the focus.

If you have multiple TreeViews on a single page, you might want to highlight only the TreeView having focus. Otherwise the user wouldn't know which element is currently selected. But that's the only reason I can think of. Probably this is a designer error of this particular control?

You can test AccessKey in Teleriks Demo page where you get this result:

Screenshot of TreeView Demo

The demo displays the HideSelection property set to false, which I think should be default instead of true, as documentation says. This issue have also been answered on Stackoverflow C# WinForms highlight treenode when treeview doesn’t have focus.

share|improve this answer
1  
You are(were?) able to distinguish a focused from an unfocused treeview selection as an unfocused tree/listview displayed the selection with a shade of grey instead of blue (using default standard theme colors). Have they changed that behavior? If so, that would be rather nonsensical...? Or has Telerik messed with the default color settings for focused/unfocused selections? –  Marjan Venema Sep 3 '12 at 12:12
    
@MarjanVenema To my knowledge, no. I haven't seen it in any webapp yet - so I think the behavior of default=true is wrong. –  Benny Skogberg Sep 3 '12 at 12:21
    
Hang on, it is a .net control. Which necessitates that it works in a browser on Linux as well. So it can't use the windows native treeview. Which is what I am used to and thus was talking about. The .net control doesn't appear to have any properties to control the color in which the selected node is shown. In that case the default probably should be to hide the selection. Then again how often would you have two or more treeviews on a form? Lists, yes, but trees? –  Marjan Venema Sep 3 '12 at 17:44
    
@MarjanVenema You're confusing WinForms and ASP.NET here. WinForms uses the native Windows controls AFAIK. Actually this is the same situation as Delphi TListView. ASP.NET is a different story altogether. AFAICS the ASP.NET version doesn't have a HideSelection property: msdn.microsoft.com/en-us/library/… –  Jens Mühlenhoff Sep 4 '12 at 8:24
    
@BennySkogberg The test page you found is about the ASP.NET control, I was asking about the WinForms / native Windows one. –  Jens Mühlenhoff Sep 4 '12 at 8:27
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.