views:

16

answers:

2

Hi all, please help.

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!

A: 

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?

Tergiver
I want control can to resize with the parent control (when the min size limit not reached). And I want to enable scrolling for case when we can't see the right part of the control.
w1z
+2  A: 

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.

Hans Passant
AAAA!! Thanks a lot!!! You are right!
w1z