Winform助手行 [英] winform assistant line

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

问题描述

嗨 我准备了一个允许用户拖动控件的程序,现在请求可以拖动的辅助行,附近的控件可以跟随此行移动或更改其大小.

解决方案


  1. 为您的应用定义"near"的确切含义,例如
  2. 定义控件如何捕捉到此行,例如,从线的左侧或右侧.
  3. 移动线(拖动或其他方式)时,确定所有控件的距离,水平捕捉线的垂直距离和垂直捕捉线的水平距离.如果距离小于指定的阈值,则在前一种情况下垂直调整线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.

解决方案


  1. 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.
  2. Define how controls snap to this line, e.g. from the left of the line or from the right.
  3. 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屋!

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