VisualStyleRenderer.GetTextMetrics(IDeviceContext) 方法

定义

检索有关由当前视觉样式元素指定的字体的信息。Retrieves information about the font specified by the current visual style element.

public:
 System::Windows::Forms::VisualStyles::TextMetrics GetTextMetrics(System::Drawing::IDeviceContext ^ dc);
public System.Windows.Forms.VisualStyles.TextMetrics GetTextMetrics (System.Drawing.IDeviceContext dc);
member this.GetTextMetrics : System.Drawing.IDeviceContext -> System.Windows.Forms.VisualStyles.TextMetrics
Public Function GetTextMetrics (dc As IDeviceContext) As TextMetrics

参数

dc
IDeviceContext

此操作将使用的 IDeviceContextThe IDeviceContext this operation will use.

返回

一个 TextMetrics,提供有关由当前视觉样式元素指定的字体的信息。A TextMetrics that provides information about the font specified by the current visual style element.

异常

dcnulldc is null.

适用于