AmbientProperties AmbientProperties AmbientProperties AmbientProperties Class

定义

为顶级控件提供环境属性值。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类总是设置ForeColorBackColor属性。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 的浅表副本。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)

适用于

另请参阅