流量布局面板 - 控制新/已移除控件的流量 [英] Flow layout Panel - controlling flow on new/removed control

查看:110
本文介绍了流量布局面板 - 控制新/已移除控件的流量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试图找出如何更好地控制flowlayout面板的实际流量。



我可以在右侧看到你可以设置它所以它左转,从右到左从上到下等,但我需要一个选项,我似乎无法找到它。



我'能够从flowlayoutpanel中删除文本框 - 我可以随时在屏幕上显示最多8个文本框。当我点击文本框时,它会删除该文本框。



但是,当我删除文本框时,正如流程所示,它会将每个控件都移动一个。 />


这不是我需要的。



在创建时,我希望它遵循为此设置的流量规则flowlayout面板,但是当移动一个控件时,我不希望这些项目向下移动。



简而言之,如果删除了一个文本框,当一个新的框是创建它会看到左边的第一个开放空间。



这可能吗?

I'm trying to find out how to get more control on the actual flow of the flowlayout panel.

I can see on the right hand side you can set it so it goes lefttoright, right to left top to bottom etc, but I need one more option, and I can't seem to find it.

I'm able to remove textboxes from the flowlayoutpanel - I can have upto 8 textboxes on the screen at anytime. When I click on the textbox, it removes that textbox.

But, when I remove the textbox, as the flow suggests it will shift every control down one.

That's not what I need.

On creation, I want it to follow the flow rules set for the flowlayout panel, but when a control is moved, I don't want the items to shift down.

In short if a textbox is removed, when a new box is created it would look to see the first open space on the left.

Is this possible?

推荐答案

我真的怀疑你发明的设计是一个很好的设计,但你可以实现它。例如,您可以使用自定义控件(而不是控件):面板和子控件。而不是删除控件,隐藏它,并将其父面板保留为占位符。在显示控件时,需要将面板的大小调整为其子控件,但在隐藏控件时保留大小。然后,当新控件选择第一个开放空间时,您可以用其他东西替换隐藏控件以模仿情况。

-SA
I really doubt that the design you have invented is a good design, but you can implement it. For example, you could use, instead of your controls, a custom control: a panel and a child control on it. Instead of removing the control, hide it, and leave its parent panel as a placeholder. You need to adjust the size of the panel to its child control when you shown the control, but preserve the size when you hide it. Then you can replace the hidden control with something else to mimic the situation when a new control picks a first "open space".
—SA

这篇关于流量布局面板 - 控制新/已移除控件的流量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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