<?xml version="1.0" encoding="UTF-8"?><item><title>Hosting the Windows Forms Designer for Things Other than Controls</title><description>&lt;P&gt;The .NET framework supports hosting a design environment for forms.&lt;/P&gt;&#13;
&lt;P&gt;This is interesting stuff - this framework support is what's used in Visual Studio .NET, making it really easy to make your own applications that allow users to design forms.&amp;nbsp; This is how a number of other .NET &lt;A href="http://www.sharpdevelop.com/OpenSource/SD/Default.aspx"&gt;IDEs&lt;/A&gt; have managed to look and feel so much like VS.NET - they gave us the pieces VS.NET is made from.&lt;/P&gt;&#13;
&lt;P&gt;There isn't a lot of good Microsoft documentation on exactly how you do it, but there are some good articles on the net - here's a good one called &lt;A href="http://www.divil.co.uk/net/articles/designers/hosting.asp"&gt;Hosting Windows Forms Designers&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;&#13;
&lt;P&gt;The design environment, once you've got it set up, seems like it would be ideal for working on any collection of 2D objects - you drop your object on the surface, and the designer takes care of the UI for dragging it around and editing properties.&amp;nbsp; &lt;/P&gt;&#13;
&lt;P&gt;However, it really is only suited to designing forms, or other surfaces that contain controls.&amp;nbsp; &lt;/P&gt;&#13;
&lt;P&gt;I did some tests of trying to use this for a simple 2D shape editor, and for one thing, there's no way to &amp;#8220;zoom in&amp;#8221; or &amp;#8220;zoom out&amp;#8221;.&amp;nbsp;&amp;nbsp;Even if you did implement shapes that supported the required interfaces, you'd just have shapes you could put on a form (nothing wrong with that I guess, but that's not what I wanted).&amp;nbsp;&lt;/P&gt;&#13;
&lt;P&gt;But the architecture is well thought out, and very flexible, so I ended up implementing something very much like it, but with more of a 2D imaging flavour.&amp;nbsp; The surface contains the &amp;#8220;design objects&amp;#8221; which are things that know how to visually edit other objects, which know how to draw themselves.&amp;nbsp;&lt;/P&gt;&#13;
&lt;P&gt;This got me wondering if this is something that would make sense as a &amp;#8220;common control&amp;#8221; of sorts - a surface that let you place objects on it that was designed for&amp;nbsp;any 2D object, not just controls, and that supported things like printing, zooming, rotating.. &lt;/P&gt;&#13;
&lt;P&gt;I'd certainly find it useful.&lt;/P&gt;&#13;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description><pubDate>Thu, 01 Sep 2005 19:17:06 GMT</pubDate></item>