开发者

Anchoring controls to a parent control that is not a form using C#

I have a panel being used like a subform. What I would like is to restrict the panel to some maximum size. When the form is maximized or resized, the subform is resized only to some maximum height and width. Couldn't find a property to limit the size of the panel so I did it manually by handling its resize event. That's okay because it's only one control.

The p开发者_开发知识库roblem is with the controls inside the panel. I thought it was simply a matter of anchoring some of the controls to the panel. Wrong! It looks like they're being anchored to the form. Any solultions besides manually resizing all the controls?


Make sure that the controls have been added to the Controls collection of the Panel. If they have, your scenario should work as expected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜