ContainerControl.CurrentAutoScaleDimensions Property

Definition

获取屏幕的当前运行时尺寸。Gets the current run-time dimensions of the screen.

public:
 property System::Drawing::SizeF CurrentAutoScaleDimensions { System::Drawing::SizeF get(); };
[System.ComponentModel.Browsable(false)]
public System.Drawing.SizeF CurrentAutoScaleDimensions { get; }
member this.CurrentAutoScaleDimensions : System.Drawing.SizeF
Public ReadOnly Property CurrentAutoScaleDimensions As SizeF

Property Value

SizeF

包含当前每英寸点数 (DPI) 或屏幕的 Font 大小的 SizeFA SizeF containing the current dots per inch (DPI) or Font size of the screen.

Attributes

Exceptions

未能为当前屏幕创建 Win32 设备上下文。A Win32 device context could not be created for the current screen.

Remarks

CurrentAutoScaleDimensions 属性表示当前屏幕上的引用尺寸。The CurrentAutoScaleDimensions property represents the reference dimensions on the current screen. 与此相反,AutoScaleDimensions 属性表示当前控件的设计环境的设计时引用尺寸,而 AutoScaleFactor 属性是两者的比率。In contrast, the AutoScaleDimensions property represents the design-time reference dimensions of the design environment for the current control, while the AutoScaleFactor property is the ratio of the two.

维度值的解释取决于 AutoScaleMode 属性,方法如下:The interpretation of the dimension value depends on the AutoScaleMode property in the following ways:

  • 如果 Dpi模式,则此属性表示屏幕的分辨率(以每英寸点数为单位)。If the mode is Dpi, this property represents the resolution of the screen, in dots per inch.

  • 如果 Font模式,则此属性表示以像素为单位的平均字体字符大小。If the mode is Font, this property represents the average font character size in pixels.

如果 AutoScaleMode 属性设置为 None,则 CurrentAutoScaleDimensions 设置为等于 AutoScaleDimensionsIf the AutoScaleMode property is set to None, CurrentAutoScaleDimensions is set equal to AutoScaleDimensions.

有关自动缩放的详细信息,请参阅Windows 窗体中的自动缩放For more information about automatic scaling, see Automatic Scaling in Windows Forms.

Applies to

See also