我有一个从Control派生的自定义控件,该控件被动态添加到表单中。控件在位置中可以具有负值,并且默认情况下是相对于左上角绘制的。
I have a custom control derived from Control which is dynamically added to the form. The control can have negative values in Location and is by default painted relative to the top left corner.
我如何才能使控件具有负坐标并相对于右侧绘制
How can I get the control to have negative coordinates and painted relative to right bottom corner for example?
推荐答案问题标题和问题问了两个不同的问题。
The question title and the question ask two different things.
标题:是的,您可以进行相对放置,但是您需要使用嵌套的布局面板,例如TableLayoutPanel和FlowLayoutPanel。他们应该能够完成大部分(如果不是全部)您想做的事情。
For the title: yes, you can do relative placement, but you'll need to use nested layout panels, like TableLayoutPanel and FlowLayoutPanel. They should be able to do most, if not all, of what you want to do.
对于实际问题:
更多推荐
如何在WinForms中使子控件的位置相对?
发布评论