ContainerControl.CurrentAutoScaleDimensions 屬性


取得螢幕目前的執行階段維度。Gets the current run-time dimensions of the screen.

 property System::Drawing::SizeF CurrentAutoScaleDimensions { System::Drawing::SizeF get(); };
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.

如果 AutoScaleMode 屬性設定為 NoneCurrentAutoScaleDimensions 則會設定為等於 AutoScaleDimensionsIf 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.