C#多个自定义控件一起工作 [英] C# Multiple custom controls working together

查看:70
本文介绍了C#多个自定义控件一起工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.我一直在试图围绕如何启动我要设计的项目进行思考,老实说,我只是不了解如何使对象(或主要是我的自定义控件)一起工作.

好的,这是示例.我想使用一个面板,但在该面板上我想要连接器点(有点像在powerpoint对象中看到的那样),而我真的不知道要使用哪些对象作为连接器点.因此,然后我可以使用自定义的弯头连接器单击鼠标左键并将其拖动到其他对象,从而使线固定在连接器点上的那些对象上.

我希望能有所作为.它就像powerpoint一样,但我打算稍后使用可视化界面与数据系统一起使用.

如果有人可以提供任何建议,请给我,我将非常非常高兴.我已经尝试这样做了大约3个月....

谢谢,TheChazm

好的,所以有些人似乎认为我不清楚我的问题.尽管我的问题中没有什么是具体的,因为我不知道该问些什么,因为我不知道我能做什么,但是这里有.另外,我并没有在寻找任何特定的代码,而只是问我应该朝哪个方向前进.

问题:
1.我应该在自定义控件上使用哪个对象或控件以使其充当一个点,以便我可以在其上单击鼠标左键并开始在其上画一条线?这将使该行固定在该对象上.

Hello all. I have been trying to wrap my thoughts around how to start this project I want to design and honestly I just dont understand how to get objects, or mainly my custom controls, to work together.

Ok here is the example. I want to use a panel but on that panel I want connector points(kind of like what you would see in powerpoint objects), and I really don''t know what objects to use for connector points. So then I could use my custom elbow connector to left click and drag it to the other object making the line fixated on those objects at the connector points.

I hope that made sence. Its just like powerpoint is what I am after but I intend later on using the visual interface to work with a data system.

Please if anyone can offer any advice on where to go with this I would extremely be very greatfull. I have been trying to do this now for about 3 months....

Thanks, TheChazm

Ok so some people seem to think I am unclear on my questions. While nothing in my question is to specific because I dont know exactly what to ask about since I don''t know what I can do, but here goes. Also I am not looking for any specific code I am just asking on which direction I should take.

Question:
1. What object or control should I use on a custom control that would allow it to act as a point so I can left click on it and start to draw a line off of it? This would keep the line fixated to that object.

推荐答案

您好,

我做了几乎相同的事情,但是由WPF为一家公司做的.
我做了一些图标,将它们与线连接在一起. (像VISIO)

我从未见过针对连接器点的任何准备好的用户控件.至少我不知道.

我建造了它,我认为您必须建造.

1.将对象的尺寸和坐标保存在某处.
2.委托对象移动.
3.解雇代表后,检查尺寸和坐标并在它们之间画一条线.
4.重新保存新的尺寸和坐标.
Hello,

I did almost a same thing but by WPF for a company.
I made some Icons that they where connected together with lines. (Like VISIO)

I''ve never seen any prepared user control for connector point. At leat I don''t know.

I built it and I think you have to build.

1. Save dimensions and coordinates of objects somewhere.
2. make delegate for object movements.
3. After firing the delegate, check dimensions and coordinates and draw a line between them.
4. Resave new dimensions and coordinates.


这篇关于C#多个自定义控件一起工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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