Alex Rivera | Logout

WPF multi-line TabControl without rearranging rows

Asked 2011-04-04T13:02:23.877
13

The WPF TabControl with its default TabPanel arranges tab items into multiple rows when the horizontal size is too small. Then the tab selection changes the order of these rows, so the selected tab item is always in the first row.

I found several articles on how to replace TabPanel with another items control so instead of the multiline behavior they get scrolling tabs.

I would like to keep the multiple rows (no scrolling), but disable the rearrangement of rows. Once the tabs are created, they should stay in position, no matter how the selection changes. Is this possible?

Edit
Report

1 Answer

1

The only solution I found was modifying the framework's TabPanel class so that its int GetActiveRow(int[] solution) method always returns 0. Although this solves the problem, I'm not sure it is legal to use the framework's source in this way.

answered 2011-05-30T18:48:51.783

Your Answer