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.

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s