问题:锚定控件重叠 [英] Problem: Anchored controls are overlapping

查看:27
本文介绍了问题:锚定控件重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我们在同一行"上有两个面板、列表框等……行"我的意思是它们的 TOP 属性是相同的,因此它们水平地处于同一级别.现在如果我将这两个控件的锚点属性设置为左上角和右上角并拖动窗体的右侧,则左侧的控件将与右侧的控件重叠,并且变得非常难看.我怎样才能既实现这个调整大小的目标,又不使用我们在 C# 中拥有的新东西,比如 TableLayout .

Let's say we have two panels, listboxes, etc... on the same "row" .. by "row" I mean their TOP property is the same so they are horizontally at the same level. now If I set the anchor property of these two controls to top-left-right and I drag the right side of the form, the contorl that is at left hand side will overlap the control at the right hand side and it gets so ugly. How can I both achieve this resizing goal and also NOT to use the new things we have in C# like TableLayout .

谢谢

推荐答案

你无法从 Anchor 属性中解决这个问题,TLP 是一个显而易见的解决方案.如果您不想使用它,则实现表单的 Resize 事件并自己修改控件的 Location 和 Size 属性.

You cannot get this out of the Anchor property, a TLP is an obvious solution. If you don't want to use that either then implement the form's Resize event and modify the controls Location and Size properties yourself.

这篇关于问题:锚定控件重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆