TheGrovesy
TheGrovesy

Reputation: 273

Best way to create very graphically custom controls

I need to create a new application which is pretty graphics heavy, by this I mean the application will allow the user to drop 'function blocks' (FB) onto the form.

Each FB can have any number of connecting points. The user can then join the different points to each other. Function Blocks will also be re-positionable, and the 'connecting lines' will then re-route themselves.

Something similar to this https:

enter image description here

My first thought is to use just use Custom controls. However as their appearance can change quite signifigantly (depending on the number of joint point, type of FB, etc) I wonder if I should be doing this differently? Maybe writing something from scratch?

Or should I not even be using Windows Forms for this at all?

I am also typically a WinForms developer and wonder if WPF would be better for this type of application?

Upvotes: 0

Views: 97

Answers (2)

Peter Bons
Peter Bons

Reputation: 29840

It depends a bit on what the scenario is. If you want to user to be able to create some kind of workflow and then execute it then I would suggest taking a look at the Windows Workflow Foundation (WF). It comes with a designer you can host in your application. This will provide support for rearranging the function blocks (called activities in WF). It uses WPF to render the activities so you can create some nice looking ones. See https://adrianot75.wordpress.com/2010/11/05/sample-real-world-wf4-integration/ for a couple of screenshots what it could be like.

If it is just drawing I would definitely take a look at WPF as it will offer much more flexibility when it comes to create some nice looking controls. You can easily host WPF controls on a WinForms form.

By the way, did you take a look on 3rd party components as well? Can't imagine that there is not a suite offered for this kind of application. Like http://www.nwoods.com/products/godiagram/samples.html for example

Upvotes: 1

Halid
Halid

Reputation: 448

Advice: WPF is much better when it came to graphics

Upvotes: 1

Related Questions