Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 32,073 times

Contents

Downloads

Related Categories

Hosting Windows Forms Designers - Introduction

divil

Introduction

I decided to write this article not because there is a strong demand for this information, but because there is literally no existing information out there on the topic. The documentation is scarce if any, and aside from a few tidbits thrown out by Microsoft it is a daunting task. It requires you to already be very familiar with the design-time architecture, and have a strong grasp of all the interfaces you commonly use.

All the interfaces you rely on when developing designers and extending the design-time behaviour of your controls, it is now your responsibility to implement. Not only is this a non-trivial task, but it is one of those times where you have to implement a great deal before you can see any progress at all. That said, once you've written the code you'll never have to write it again (and since I'm going to be writing it for this article, you'll never have to write it in the first place).


The accompanying sample application demostrates the code we discuss in this article

Why would you want to host the Windows Forms Designers? Well, there could be lots of reasons. When I was faced with the problem it was because I was writing an IDE for .NET languages and I wanted a visual interface to configure GUIs, just like VS.NET has. When you consider the flexibility of the designer architecture, you realise you have a framework for designing any 2-dimensional hierarchical system. All the code for moving, resizing, creating, deleting and configuring items is already there.

The one you see in VS.NET is running from the framework, and is the same one we'll be writing the code to enable. All the designer stuff is already present in the framework, you just need to write the code to bind it all together. This was best left out of the framework because it is strongly tied to the host environment.

Comments

  • Re: [4351] Hosting Windows Forms Designers

    Posted by timker on 20 Jul 2007

    I have (am still) modifying this code to create a stand-alone Xaml generator for forms. The Xaml is structured for direct consumption by Windows Presentation Foundation. This was a great starting p...

  • Re: Hosting Windows Forms Designers - PocketPC

    Posted by vitek on 17 Jan 2007

    hallo,
    how to change Designer for design PocketPC components?

    htx

    v!tek

  • Re: [4351] Hosting Windows Forms Designers

    Posted by jharry on 30 Oct 2006

    Hi Tim, great article. I am currently creating a designer in a similar manner to your article, used to create pdf files. I am using it to add only textboxes and pictures, and can save the data to&n...

  • Control coordinates

    Posted by hugobq on 19 Sep 2006

    Tim:

    Thanks for your nice article.

    How can I get the location of a control in the design surface. I want to show the coordinates when the user moves the control, but I can't figure how...

  • Re: Remove controls from te form

    Posted by NewbieDude on 11 Jul 2006

    Did you ever figure out how to remove controls from the form?  I need to do that same now