.NET Hobbyist Programmer

Staying Confused in a Busy World
posts - 257, comments - 204, trackbacks - 673

My Links

News

Neat Stuff Read all my hurricane entries While you are here, visit the Geeks With Blogs main feed
Advertising
Links Status of the Navy
Channel 9

Tag Cloud

Article Categories

Archives

Post Categories

Custom Forms Designer: The Goal

My previous post on a .NET custom forms designer was a basic listing of the samples that are out there and some of their merits.  It was not an exceptionally enlightened piece, so I intend to correct a few things and add some additional detail over the next couple of weeks.  I included a listing of interfaces and made an unfulfilled hint at completing a full-featured design surface.  I’ll get to the point eventually, so bear with me on this.  We are off on a voyage of discovery....

I listed five examples of design surfaces in that first post.  I will be throwing out two of them from consideration, but for different reasons.  The first to be tossed is the MSDN GDI+ sample.  This does not interact with the core .NET designer and is actually a poor substitute at trying to emulate it.  It is OK for what it tries to do, but it does not fit my ultimate goal, which I’ll get to shortly.

The second example to be tossed is SharpDevelop.  I am not trying to recreate Visual Studio as they are.  SharpDevelop also has what can only be called an intricate extensible structure of "codons".  Their extensibility structure seems to have created lots of additional work with little perceivable benefit.  Perhaps I’m wrong.  Anyway, you are welcome to look at their work, but the GPL restrictions were enough to turn me off.

That leaves us with three samples.  For ease of reference, I’ll shorten their names as follows:

From these three samples, I intend to work towards a Windows Forms design surface that I will be able to then customize for my specific application.  Therefore my goal is a rich design environment that will permit my users to create custom forms.  Eventually, I'll create some custom controls and restrict them to only using those, but that is far in the future.  In the meantime, I need to create a designer.

I need to make a few corrections to my earlier comments.

The Dawson sample consists of code and a brief accompanying article.  There is some depth to parts of the discussion, but it does not cover things in detail.  Overall, it is great and was the first published effort I found.  The presented sample is very rough, but it works.  The toolbox is actually a Listbox with the names of the controls.  There is simple functionality.

The MSDN sample is far ahead of the Dawson version.  Interestingly, I wondered if they came from the same code base, since there were some amazing similarities I saw.  The MSDN toolbox is a Treeview with drag-and-drop functionality.  Tools and icons are loaded from those installed on the user’s machine with the framework.  Functionality is much better.

The MSKB sample is actually the best of the three.  There is no real accompanying article, but the code is well-commented.  In fact, the code appears to have been excised from a larger, more-finished program.  There are several stubs present for additional interface implementations.  These may well be the remains of routines left after custom code was removed, but their retention is appreciated.  Many of the comments look suspiciously like the remains of XML comments that have had their XML wrappers deleted.  This sample has by far the best functionality.  Keyboard and menu commands are included.  Code display in both VB and C# is supported.  The toolbox looks much like Visual Studio’s and supports both mouse and keyboard.  Overall, it wins as the most complete example.

Print | posted on Thursday, January 06, 2005 9:29 PM | Filed Under [ Programming Forms Designer ]

Feedback

Gravatar

# re: .NET Custom Forms Designer: The Goal

Just in case you're not aware, the 2.0 framework includes all class implementations necessary to host designers. In fact, the Visual Studio 2005 designer uses the one built in to the framework, instantly giving you undo/redo and serialization support without having to write all the code these articles are about.
1/9/2005 6:46 PM | Tim Dawson
Gravatar

# re: .NET Custom Forms Designer: The Goal

Hi there

Thanks for your summary - very useful :-).
I'd also be interested in the process of code (de)serialization - how could I parse the source of winform and load it into a custom designer?

There are either no resources available on this or I'm searching for the wrong topics :-/. Any links on this?
3/24/2005 1:42 PM | Philipp
Gravatar

# re: .NET Custom Forms Designer: The Goal

Philipp: Take a look at the MSKB sample and trace through what happens when you click on File | Open. The SampleDesignerLoader.cs BeginLoad routine and its use of the SampleDesignerSerializationManager is what you are looking for.
3/24/2005 7:49 PM | Mark
Gravatar

# re: .NET Custom Forms Designer: The Goal

2Tim Dawson.

Would you give a link where you take an information about new features of Form Designer, DesignSurface and serialization/deserialization?
5/11/2005 11:09 AM | Grenal
Gravatar

# re: .NET Custom Forms Designer: The Goal

A JScript designer would be nice. JScript didn't have any.
6/30/2005 8:42 PM | App
Gravatar

# re: .NET Custom Forms Designer: The Goal

Hi Tim,

How's it going with the Designer for .NET 2.0. I have recently implemented a custom forms designer in Whidbey Beta2 but I'm having some problems with a) A CodeDom designerLoader and b) Serializing some .NET 2.0 controls.
8/5/2005 3:54 AM | Graham Allwood
Gravatar

# re: .NET Custom Forms Designer: The Goal

Hi there!,

Let me say that your blog'w page is very, very nice and absorbing. All documentation referenced in this article or blog is very useful, but... i have a question about the undo/redo feature in the designer host:

I know that the Framework 2.0 implements this commands easily... but i don't know how!!. Someone can gives me an example?.

Using GlobalInvoke(StandardCommands.Undo) doesn't works!.

Thank you a lot in advance!
César
1/17/2006 4:47 PM | César F. Qüeb Montejo
Gravatar

# re: .NET Custom Forms Designer: The Goal

Never in mind!

I have found the solution to my previous request. Anyway..., i assume that this page never was readed!!

Bye
1/30/2006 8:02 AM | César F. Qüeb Montejo
Gravatar

# re: .NET Custom Forms Designer: The Goal

How SnapToGrid works? I downloaded the code and try to run it from Microsoft site everything works execep SnapToGrid and ShowGrid, can anyone help me with this.
7/16/2007 12:00 PM | ashokbaria
Gravatar

# re: Custom Forms Designer: The Goal

Take a look at this sample for implementing a snap-to-grid feature...


http://www.vb-helper.com/howto_snapto.html


Hope it helps.
11/1/2007 12:29 PM | Claudio Lins
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: