w1z
w1z

Reputation: 537

.NET Tab Contol. Not scroling when chield control have a min size and anchor right

I have a simple dialog with tab control whit property Dock = Fill. On the tab page I add another control and set its properties Anchor as 'Left, Top, Right' and min size as '600,300' for example. I set the property of tab page AutoScrolling to true. But when I resize the dialog the horizontal scrolling of the tab page doesn't work when the dialog width is smaller than min width of the chield control. Why horizontal scrolling doesn't work in this case? Is it bug or maybe feature?

Thanks a lot!

Upvotes: 1

Views: 270

Answers (2)

Hans Passant
Hans Passant

Reputation: 941545

I can't even get the scrollbar to show up. Right/bottom anchors don't work well when auto-sizing layout. Set the AutoScrollMinSize property to an appropriate value, that also ensures you've got enough margin to the right of the button.

Upvotes: 3

Tergiver
Tergiver

Reputation: 14517

It's because of the Anchor. You anchored it on the left and right which means that it will have no minimum width, its width is determined by its container's size.

What is the effect you're trying to achive?

Upvotes: 1

Related Questions