>
> "Peter Kenyon" <p.kenyon.no.spam@paradise.net.nz> wrote in message
> news:OH4mt6UoEHA.3668@TK2MSFTNGP15.phx.gbl...
>> Hi,
>>
>> Microsoft have provided an excellent example of hosting the form designer
>> here:
>>
http://support.microsoft.com/default.aspx?scid=kb;EN-US;813808 >>
>> However, it has one problem: the Name property does not appear in the
>> property grid. Their code does include an extender provider which should
>> provide the name property, however it does not work. Are there any gurus
>> here who have used this code and have managed to get the Name property to
>> appear?
>>
>> TIA
>>
>> Peter
>
> In case anyone runs into the same problem, here is how to do it:
>
> 1. The designer host class needs to implement the IExtenderListService
> interface, otherwise its extender providers are never used.
> IExtenderProvider only has one method, which can be implemented like so:
>
> public IExtenderProvider[] GetExtenderProviders()
>
> {
>
> IExtenderProvider[] providers = new
> IExtenderProvider[extenderProviders.Count];
>
> extenderProviders.CopyTo(providers);
>
> return providers;
>
> }
>
> 2. The two extender providers SampleNameExtenderProvider and
> SampleInheritedNameExtenderProvider have a line in their CanExtend()
> method which prevents them adding a Name property to the base component
> (ie the form). By commenting this line out like so:
>
> /*
>
> if (o == Host.RootComponent) {
>
> return false;
>
> }
>
> */
>
> the form's Name property can be set, as well as components on the form.
>
>
>
> Peter
>
>