AmbientProperties 類別

定義

提供最上層控制項的環境屬性 (Ambient Property) 值。Provides ambient property values to top-level controls.

public ref class AmbientProperties sealed
public sealed class AmbientProperties
type AmbientProperties = class
Public NotInheritable Class AmbientProperties
繼承
AmbientProperties

備註

環境屬性是控制項上的屬性,如果未設定,則會從父控制項抓取。An ambient property is a property on a control that, if not set, is retrieved from the parent control. 如果控制項沒有父代,而且未設定屬性,控制項會嘗試透過屬性尋找環境屬性的值 SiteIf the control does not have a parent and the property is not set, the control tries to find the value of the ambient property through the Site property. 如果控制項未放置,則網站不支援環境屬性,或是在物件上未設定此屬性,會 AmbientProperties Control 使用它自己的預設值。If the control is not sited, the site does not support ambient properties, or the property is not set on the AmbientProperties object, the Control uses its own default values. 某些衍生自類別的物件 Control 可能會設定屬性(即使您沒有的話)。Some objects derived from the Control class might set the property even if you do not. 例如, Form 類別一律會設定 ForeColorBackColor 屬性。For example, the Form class always sets the ForeColor and BackColor properties.

建構函式

AmbientProperties()

初始化 AmbientProperties 類別的新執行個體。Initializes a new instance of the AmbientProperties class.

屬性

BackColor

取得或設定物件的環境背景色彩。Gets or sets the ambient background color of an object.

Cursor

取得或設定物件的環境游標。Gets or sets the ambient cursor of an object.

Font

取得或設定物件的環境字型。Gets or sets the ambient font of an object.

ForeColor

取得或設定物件的前景色彩。Gets or sets the ambient foreground color of an object.

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於

另請參閱