R – WPF TabControl with ‘new tab’ button

tabcontrolwpf

I have a TabControl in a WPF app, and I want to add a 'new tab' command to the tab strip (like tabbed web browsers have).

I've had a look at the template in Blend for the TabControl, but I can't figure out how best to add my new button to the right of the last tab. What's the best way of doing this?

Best Answer

There's about 30 ways to do this, but this CodeProject link might be what you are looking for: http://www.codeproject.com/KB/WPF/WpfTabControl.aspx

It has a "New" (although it's on the left, rather than on the right like Google Chrome). It's a drop-in control, rather than a bunch of complicated Xaml styling. I'm personally still looking for the crazy Xaml style for this, but in the interim this control is working pretty darn well. Possibly it does exactly what you need.

Hope this helps, Anderson