用一条线连接2个用户控件? [英] Connecting 2 user controls with a line ?

查看:89
本文介绍了用一条线连接2个用户控件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我知道e.Graphics.DrawLine(...);



但我想用另一个用户控件连接它们,任何想法?< br $>




LINE UC

| UC1 | -----> | UC2 |

Ok, i know e.Graphics.DrawLine(...);

But i want to connect them with an another user control, any idea ?


LINE UC
|UC1| -----> |UC2|

推荐答案

计算要连接的两个控件的大小和位置,找出控件的哪一侧应该连接,计算中心的位置对于每个控件,并在这两个点之间绘制线。
Calculate the size and position of both controls you want to connect, find out which side of the controls should be connected, calculate the position of the centre of that side for each control and draw the line between those 2 points.


这篇关于用一条线连接2个用户控件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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