AmbientProperties AmbientProperties AmbientProperties AmbientProperties Class

定義

提供最上層控制項的環境屬性 (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
繼承
AmbientPropertiesAmbientPropertiesAmbientPropertiesAmbientProperties

備註

環境屬性是控制項上的屬性, 如果未設定, 則會從父控制項抓取。An ambient property is a property on a control that, if not set, is retrieved from the parent control. 如果控制項沒有父代, 而且未設定屬性, 則控制項會嘗試透過Site屬性尋找環境屬性的值。If 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類別一律會ForeColor設定和BackColor屬性。For example, the Form class always sets the ForeColor and BackColor properties.

建構函式

AmbientProperties() AmbientProperties() AmbientProperties() AmbientProperties()

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

屬性

BackColor BackColor BackColor BackColor

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

Cursor Cursor Cursor Cursor

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

Font Font Font Font

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

ForeColor ForeColor ForeColor ForeColor

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

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)

適用於

另請參閱