in Uncategorized

Creating Scrolling Tabs Using WPF’s TabControl

Someone posted a question in the WPF MSDN forums today where they wondered if it was “easy” to change the default stacking behavior of the TabControl to use the scrolling paradigm used in an application such IE7 or Visual Studio instead.

It turns out this is actually very “easy” in that you don’t have to write a single line of C#. Instead you simply need to edit the ControlTemplate for the TabControl. I replied to the post with some sample XAML that provides the basic approach to acheiving this. Be forewarned that the visuals aren’t exactly pretty by designer standards, but I think the sample still gets the point across. ;P

I loooove examples like this because they really show just how powerful the templating model inside of WPF is, which is made possible by the powerful separation of the logical and visual trees.

Leave a comment


  • Related Content by Tag