ContainerControl.CurrentAutoScaleDimensions ContainerControl.CurrentAutoScaleDimensions ContainerControl.CurrentAutoScaleDimensions ContainerControl.CurrentAutoScaleDimensions Property

定義

取得螢幕目前的執行階段維度。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

屬性值

SizeF,其中含有螢幕的目前 Dots Per Inch (DPI) 或 Font 大小。A SizeF containing the current dots per inch (DPI) or Font size of the screen.

例外狀況

無法針對目前的螢幕建立 Win32 裝置內容 (Device Context,DC)。A Win32 device context could not be created for the current screen.

備註

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.

如果屬性設定為None CurrentAutoScaleDimensions,則會設定為等於。 AutoScaleDimensions AutoScaleModeIf the AutoScaleMode property is set to None, CurrentAutoScaleDimensions is set equal to AutoScaleDimensions.

如需自動調整的詳細資訊, 請參閱Windows Forms 中的自動調整For more information about automatic scaling, see Automatic Scaling in Windows Forms.

適用於

另請參閱