want to make scrollable tabs for a tabcontrol

后端 未结 6 811
故里飘歌
故里飘歌 2020-12-05 14:22

Say I have a tab control, and I have over 50 tabs, where there is no enough space to hold so many tabs, how make these tabs scrollable?

6条回答
  •  独厮守ぢ
    2020-12-05 14:57

    Recently I've implemented such control. It contains two buttons (to scroll left and right) which switch their IsEnabled and Visibility states when it is necessary. Also it works perfectly with item selection: if you select a half-visible item, it will scroll to display it fully.

    It looks so:

    WPF Scrollable TabControl

    It isn't so much different from the default control, the scrolling is appeared automatically:

    
    

    I've written the article about this ScrollableTabControl class in my blog here.

    Source code you can find here: WpfScrollableTabControl.zip

提交回复
热议问题