views:

244

answers:

2

Hi Guys,

I've an idea of creating a GUI to give the user the opportunity to select some controls (textbox, gridview, labels, etc) and place it in a pallet/panel/window creating a view of the controls, that, pressing Save, it will save the X, Y, W and H of all controls (including the pallet/panel/window itself) to an XML (for later show in a Window form, either in a WebForm)

I just wanna ask the road to take on how to do this.

Kind'a Visual Studio, but MUCH simpler.

I have no idea how to start coding this.

Thank you for any tips

+3  A: 

One Way

Here is a code sample from Microsoft towards implementing a custom Forms designer, if you want to do it 'proper' way

http://support.microsoft.com/?id=813808

An MSDN article on creating custom forms designers

http://msdn2.microsoft.com/magazine/ad160d36-48ab-4644-9663-acc4f9cba999

Also, If you want more than just bare bone functionality, Sharpdevelop has a good visual form designer implementation, it is open source, so you should be able to re-use by making some tweaks.


Alternate Way

Go with DSL tools. Install Microsoft Visual SDK, create a DSL package, and use the DSL work bench to create the model notations you need.

Then use text templates to generate the XML. This is going to be very easy if you know how to work with DSL tools, but the functionality might be limited.

amazedsaint
Here is a seminar that does exactly that: http://is.gd/kdpbAnd the final twist here is also that they use there newly created designer to create a new designer...
haqwin
What a great link amazedsaint, exactly what I was looking for :)
balexandre
A: 

I would try to find a ready-made component that already does this and not develop it myself.

Any IDE, for example, has these capabilities - even MS Office lets you place controls in documents, etc.

Try to see if any of these IDEs uses a standalone component that you can reuse. Maybe a XAML editor/viewer you can use in your application, or even a VB-like designer with OLE controls.

Sorry I don't have a more concrete answer, but that's what I would do.

Assaf Lavie