c# - Make TabControl Headers Scrollable in WPF -
as mentioned in title, want alter header of tabcontrol scrollable.
the reason: have many tabitems, , wrapping not best solution in case. want alter :
to (scroll bar indicated arrow) :
can help me , show how ? (i'm using wpf)
changing tabcontrol.template
simple seems work me
<tabcontrol ...> <tabcontrol.template> <controltemplate targettype="{x:type tabcontrol}"> <grid> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition/> </grid.rowdefinitions> <scrollviewer horizontalscrollbarvisibility="auto" verticalscrollbarvisibility="disabled"> <tabpanel x:name="headerpanel" isitemshost="true" margin="0,4,0,0"/> </scrollviewer> <contentpresenter x:name="part_selectedcontenthost" margin="4" contentsource="selectedcontent" grid.row="1"/> </grid> </controltemplate> </tabcontrol.template> </tabcontrol>
c# wpf scrollbar tabcontrol
No comments:
Post a Comment