Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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.
Posted 23-Jan-12 21:32pm
Edited 24-Jan-12 6:22am
v5
Comments
Shahin Khorshidnia at 24-Jan-12 3:01am
   
Not clear. need more comment.
thechazm at 24-Jan-12 11:17am
   
I updated the question. Hopefully its understandable.
johannesnestler at 24-Jan-12 5:45am
   
you have been trying to to this for 3 months? How about to invest 3hours to formulate a clear question? What's your specific problem? Drag&Drop? Detecting? Drawing? Creating UserControls?
thechazm at 24-Jan-12 11:17am
   
I updated the question. Hopefully its understandable.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
v3
Comments
thechazm at 24-Jan-12 12:06pm
   
Yes that is the right Idea I was going for but what object or control should I modify that would work best?
Should I just make a custom connector object inheriting from Control or what?
 
I would imagine the process is roughly the same between the two (WPF, and winforms). And thanks for the steps at the bottem. See the main issue I am having is I have a custom control that is just a simple panel and I thought if I added other panels to that panel as smaller objects located on the top, bottom, left, and right sides that I could manage the events and effects from that.
But I cannot seem to get the small panels to stick outside of the main panel just a bit. It keeps cropping it off at the end of the main panel. So I need some way to build controls on top of other controls and be able to have it going on the inside edge of the control and on the outer edge.
Shahin Khorshidnia at 25-Jan-12 5:50am
   
1. I just make a custom connector object inheriting from Control or what?
What difference does it make? You want a connector point. It can be an Image or a Shape or anything that is sensitive to mouse clicking and moving.
2. I need some way to build controls on top of other controls and be able to have it going on the inside edge of the control and on the outer edge.
I think you need 2 panels. A bigger one and an interior panel. You can put the connector on the big panel and put some other objects (for example: Pics, Buttons, TextBox and etc...) on the smaller panel. If you want a nicely cut control then try to have a transparent background for the bigger panel.
Marcus Kramer at 24-Jan-12 12:15pm
   
Just updated a couple typos. +5.
Shahin Khorshidnia at 25-Jan-12 5:33am
   
Thank you mr. Kramer.
thechazm at 25-Jan-12 12:55pm
   
Thank you very much for your time and help on this. I finally have the right mind set to get this thing done. I kept wrapping myself around the appropriate object but I didn't understand was that any object could be used in this manner. Thanks for helping me out!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.1411022.1 | Last Updated 24 Jan 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100