我有这个应用程序,其中几个groupboxes在垂直线。他们可以单独启用和禁用。我希望始终将组合框对齐到顶部,而不管通常位于之间的组合框是否启用。动态GroupBoxes始终对齐顶部
假设我们有三个groupboxes(1,2,3)。中间的一个(2)被禁用。通常其他两个盒子(1,3)的位置不会受到这个影响。但我希望最后一个groupbox(3)能够取代中间groupbox(2)通常会处于的位置。
任何想法如何完成这个最简单的方法?
这是林目前做这心不是足够好缩放
if (isForgeIncluded == "True" | isForgeIncluded == "true")
{
forgeBox.Visible = true;
if (headerPic == "False" | headerPic == "false")
{
PictureBox1.Visible = false;
forgeBox.Location = new Point(6, 5);
pathBox.Location = new Point(6, 112);
}
else
{
}
}
else
{
forgeBox.Visible = false;
if (headerPic == "False" | headerPic == "false")
{
PictureBox1.Visible = false;
pathBox.Location = new Point(6, 5);
}
else
{
pathBox.Location = new Point(6, 168);
}
}
您能否展示如何创建GroupBox?你想禁用它们还是使它们不可见?如果他们在布局控件上设置,则可能需要使LayoutControl不可见。 – Bit