I’m using a TabControl with no Height and Width specified.
Actually, the height of the TabControl take the height of the current tab.
I don’t want the TabControl auto adjust it size. I want it take the size (Heigth and Width) of the biggest tab.
How can I do that ?
Thanks.
The size of your
TabControlwill be being set by its parent container control, which is responsible for the layout of its children, and will specify default values for many layout properties.If, for example, you place the
TabControlinside a (vertical)StackPanel, you’ll find that it takes the minimum vertical space that it can. If you have aGridaround your tabs, they’ll fill the available space.Alternatively, you can manually set
VerticalAlignment="Top"with other containers, and this will typically override the behaviour you’re seeing. (Most likely your layout panel is defaulting this toStretch.)