开发者

How can I create a schematic view on which I can place, move and connect items?

开发者 https://www.devze.com 2023-03-29 08:51 出处:网络
Hello fellow programmers, I have been tasked with rewriting a program for newer versions of Windows (as the original was written almost 15 years ago with Windows 3.1 and 95 in mind).

Hello fellow programmers,

I have been tasked with rewriting a program for newer versions of Windows (as the original was written almost 15 years ago with Windows 3.1 and 95 in mind).

The problem I have now is that I don't know how to create a sort of canvas on which I can place graphics and connect them to each other to create a schematic, like this.

I have looked for a solution all over the internet, but could not find anything; maybe my search terms were off... Essentially, the user has to be able to place items on the grid, connect them to each other, and of course also do editing operations like moving or deleting something. All the items also have properties which can be edited.

I was thinking of using WPF, but if this can be done more easily with another toolkit, I would be open to that too. The application will be wri开发者_如何学编程tten in C#.

If you want to have a look at the software yourself, feel free to download it here. (You need a 32-bit version of Windows to run it.) Unfortunately, it is only available in German, but you can get to this grid by opening S57901.exe, opening the project file "DEMO.PRJ" (in the program directory) then going to "Programm" > "Edit: (...)\DEMOP.PR".

Thanks in advance!


If you are going to write in C#, then take WPF. It has better support and performance for graphic applications. Also you will not have that pain with OnPaint, hit testing, scaling, etc like in WinForms.

As I know, there is no libraries that will allow to use such complex elements and manipulate them. As I understand, schemes like on example can be represented as graph, so you can consider to use library that allows graph drawing. I will not repost list of the most popular and flexible of them. Just look at search.

Update.

Found something closer to your problem:

  • Spider Control
  • WPF Diagram Designer Part4 (the list of other Diagram Designer parts)

Also take a look at yFiles for WPF. But unfortunately its not free.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号