WPF Scrolling Performance Tip: Avoid using ScrollBarVisibility=Auto
When you can, avoid using the ScrollBarVisibility value "Auto" for HorizontalScrollBarVisibility and/or VerticalScrollBarVisibility. These properties show up on ScrollViewer, TextBox , RichTextBox and ListBox (although, as an attached property on the last.) Instead, use "Visible", "Disabled" or "Hidden."
The "Auto" value is intended for cases when space is limited and ScrollBars should only be displayed when necessary. For example, it may be useful with a ListBox of 30 items as opposed to a TextBox with hundreds of lines or more of text.
Comments
Anonymous
August 14, 2006
Um...wouldn't Auto normally be the most common option? That's how listboxes in most Windows apps work, for example.Anonymous
August 15, 2006
Yes, for a ListBox, this is commonly used. In fact, the default for ListBox's HorizontalScrollBar is "Auto". The effects of using "Auto" on a "small amount" of content should be relatively neglible.Anonymous
March 16, 2008
PingBack from http://boxingcarsblog.info/henry-hahn-wpf-scrolling-performance-tip-avoid-using/Anonymous
March 22, 2008
PingBack from http://carsmaxblog.info/henry-hahn-wpf-scrolling-performance-tip-avoid-using/Anonymous
July 24, 2008
PingBack from http://nicholashome.gratishotell.com/autohanperformance.htmlAnonymous
June 16, 2009
PingBack from http://fixmycrediteasily.info/story.php?id=1517Anonymous
June 16, 2009
PingBack from http://lowcostcarinsurances.info/story.php?id=349