Question

I've got a c#, .net 4, mdi Windows Forms application which configurates a product. The product is one of a kind, it always looks different but similar.

I would like to create a simple technical 2D drawing which is created and shown based on the user input. My idea is, that the user enters the product data in one mdi form and the drawing is shown in another mdi form. The drawing should be created in its own thread, so the user does not have to wait for it.

About the drawing: It should contain lines and rectangles with different colors, filled and unfilled. Some lines/rectangles have text information next to it, f.e. to show the dimensions or a name.

I am not sure which way i should go to create the drawing. My first ideas were to use Microsoft Visio Drawing Control or just to draw on a Form. But i am not sure if thats really the way to go.

I am grateful for any suggestions. Are there any other good libraries for simple 2D technical drawings? Is Visio or Windows.Drawing the way to go? Any other ideas?

/edit: example drawing:

example drawing

/edit2: it would be useful, to highlight shapes programmatically. Also useful would be a shape mouse over event.

Was it helpful?

Solution

I used WPF as suggested and host it in ElementHost. It works pretty good, polygons have mouseover events, so you can highlight/select them and show detailed information about a linked object.

There are lot of tutorials to get started with drawing polygons and stuff. A bit more tricky was to implement zoom and drag features. Therefore i found this example which i can highly recommend: WPF simple zoom and drag support in a ScrollViewer

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top