Click here to Skip to main content
15,033,303 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have no idea what the correct name for this UI style is. In MS Access the 'relationships' tool shows the db tables as little movable boxes that can be linked with lines. It's the same with Video and a few audio apps - boxes that are movable, containing lines of text that can be joined together in a meaningful way.

How could I create a similar thing in .NET using Visual Studio 2008 and C#? I've never created my own controls before.
Is it possible via listbox??
or have to use user control
i have used listbox and label arrays now i just need to draw line betwen drag and drop item

click here for example
Updated 1-Nov-12 2:08am

As Slacker said, search for custom controls.


If your needs are simple you can try doing something like creating some "template child windows" using existing controls instead of handling paint events.

Let's say, each "box" could be like this:
|                       |
|        Title          |
|                       |
|  * Text               |
|                       |
| [] Other              |
| |---Paragraph::Source |
| |---Info::Images      |
|                       |

The box can be any "window container", also it can be a MDI Child Window, so you can move, have a title, maximize, minimize or close the window (you can even replace these events with something you like, for example: minimize would show only title bar instead of minimizing or close event to remove all connections) and move events and so.

For the Items part you could use something like a Tree View Control.

Now, for the lines you could paint it in a way it stays above all windows or use a control with transparent background and draw the line on it and keep it on foreground, you'll end up creating a custom control for it. Or you can think in another way of representing the "linking indicator" like changing the icon of Item to something representing the link or the target window icon and show the "link target" on child items of that Item inside the Tree View like in the example above.
shreyaswonder1989 1-Nov-12 7:07am
ok thank you
shreyaswonder1989 5-Nov-12 7:29am
i thought of one easy way but not sure wheather it will work or not
1)create one panel
2)Add label at position 0,0 in panel
3)Add list box in that same panel just below that label
4)set drag event on label
5)and move the whole panel
it is just a thought dont know wheather it will work or not
Thats not control !!

Thats whole bunch of toolset. It like UML class diagram. To create such thing, you need to create a whole tool like Visio. And thats a tall order !

If the aim is to create such diagram, you can use MS Visio and create class diagram. If you are using Visual Studio 2010, you can create a class diagram of your code retrospectively.

- Milind
Can we implement the above thing with the help of this link
WPF Diagram Designer - Part 3[^]
Your question cannot possibly be answered here completely, IMHO. There is so much involved with this, in regards to coding experience and knowledge. You might want to search the internet for custom controls and how to create them. Study what experienced developers are doing with custom controls.

There are a lot of articles on this site that deal with this subject, as well. I would then practice, and build your skill set on this, as well as other programming fundamentals.

-- good luck. :)

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900