Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Component.Site Property

Gets or sets the ISite of the Component.

[Visual Basic]
Public Overridable Property Site As ISite  Implements _
   IComponent.Site
[C#]
public virtual ISite Site {get; set;}
[C++]
public: __property virtual ISite* get_Site();
public: __property virtual void set_Site(ISite*);
[JScript]
public function get Site() : ISite;
public function set Site(ISite);

Property Value

The ISite associated with the Component, if any.

This value is a null reference (Nothing in Visual Basic) 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.

Implements

IComponent.Site

Remarks

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 to assign 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. It is strongly suggested that the setting of the Site property only be done by an IContainer.

The property value is a null reference (Nothing in Visual Basic) if the Component is removed from its IContainer. Assigning a null reference (Nothing) 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.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Component Class | Component Members | System.ComponentModel Namespace | IContainer | Container | ISite

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.