all groups > dotnet windows forms designtime > september 2004 >
You're in the

dotnet windows forms designtime

group:

Form Designer host and Name property


Form Designer host and Name property Peter Kenyon
9/23/2004 9:21:41 PM
dotnet windows forms designtime:
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

Re: Form Designer host and Name property Peter Kenyon
9/30/2004 12:05:36 PM

[quoted text, click to view]

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

Re: Form Designer host and Name property Pepe Lopez - [PepeLoco]
10/12/2004 8:56:27 AM
Good

Can you tell me where i find a sample of Host to Web Forms as in WebMatrix

thanks

--
Jose Lopez
Microsoft Certified Professional .Net
Microsoft Most Value Professional Asp/Asp.Net
Ecuador



"Peter Kenyon" <p.kenyon.no.spam@paradise.net.nz> escribió en el mensaje
news:eOWQVFopEHA.3708@TK2MSFTNGP10.phx.gbl...
[quoted text, click to view]

Re: Form Designer host and Name property David M.
1/25/2005 10:29:02 AM
Peter,

I tried your corrections and I still cannot get the Name property to
appear. Any other thoughts?

-David
Re: Form Designer host and Name property Frank Rush
2/8/2005 2:25:01 AM
In addition you need to add the IExtenderListService to the host in the
Designer Host constructor:

serviceContainer.AddService(typeof(IExtenderListService), this);


[quoted text, click to view]
AddThis Social Bookmark Button