Was this page helpful?
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Component::Site Property


Gets or sets the ISite of the Component.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

property ISite^ Site {
	virtual ISite^ get();
	virtual void set(ISite^ value);

Property Value

Type: System.ComponentModel::ISite^

The ISite associated with the Component, or null if the Component is not encapsulated in an IContainer, the Component does not have an ISite associated with it, or the Component is removed from its IContainer.

A Component will have an ISite if it has been added to an IContainer and the IContainer assigns an ISite to it. The IContainer is responsible for assigning the ISite to the Component. Changing the value of the component's ISite does not necessarily change the name of the site the Component is assigned to. The Site property should be set only by an IContainer.

The property value is null if the Component is removed from its IContainer. Assigning null to this property does not necessarily remove the Component from the IContainer.

A Component might or might not have a name. If a Component is given a name, the name must be unique among other Component objects within its IContainer. The ISite stores the name of the Component; therefore, you can only name a Component if it has an ISite associated with it.

.NET Framework
Available since 1.1
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft