0

Quick question: I've got a TabControl that contains several TabItems. When I switch tabs, the TabControl resizes itself based on the content of the selected (visible) tab - I assume this is standard behaviour. Is there any way to "lock" the TabControl's width & height to that of its largest TabItem?

Andrew Stephens
  • 9,413
  • 6
  • 76
  • 152

1 Answers1

3

EDIT: Removed non-answer.

But, I found this, that might help.

Community
  • 1
  • 1
TheBlueRage
  • 191
  • 1
  • 1
  • 6
  • 1
    I missed the one with the `SharedSizeGroup` trick - this is a slick way of doing it! – Andrew Stephens Jan 20 '14 at 16:37
  • Yeah, after looking at that other post... does my answer of binding to the actual height even work? – TheBlueRage Jan 20 '14 at 17:17
  • 1
    It didn't tbh, and the grid trick didn't work too well either. It only adjusts once the user has visited the other tabs - I guess WPF needs to render them first, so it knows how big they are before it can apply the SharedSizeGroup. Back to the drawing board...! – Andrew Stephens Jan 21 '14 at 09:05