Winform助手行 [英] winform assistant line
本文介绍了Winform助手行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
- 为您的应用定义"near"的确切含义,例如
- 定义控件如何捕捉到此行,例如,从线的左侧或右侧.
- 移动线(拖动或其他方式)时,确定所有控件的距离,水平捕捉线的垂直距离和垂直捕捉线的水平距离.如果距离小于指定的阈值,则在前一种情况下垂直调整线y坐标,在后一种情况下水平调整对齐线x坐标.
实施它,我就快完成了!
如果您对此仍有疑问,请随时给我评论!
问候,
曼弗雷德(Manfred)
hi I gonna a program allowing user to drag controls, Now request a assistant line that can be drag, and the controls nearby can follow this line to move or change their size.
解决方案
- Define for your application what exactly near means, e.g. a number of pixels making up a certain percentage of the total screen width for horizontal snap and the screens height for the vertical snap.
- Define how controls snap to this line, e.g. from the left of the line or from the right.
- When the line is moved (dragged or whatever), determine the distance of all controls, vertical distance for a horizontal snap line and horizontal distance for vertical snap line. If the distance is below the specified threshold do a vertical adjust to the lines y coordinate in the former and a horizontal adjust to the snap lines x coordinate in the latter case.
Implement that and you''re just about done I''d say!
If you still have questions about this feel free to leave me a comment!
Regards,
Manfred
这篇关于Winform助手行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文