语言

VisualStyleRenderer.GetFont(IDeviceContext, FontProperty) 方法

定义

返回当前视觉样式元素的指定字体属性的值。

public:
 System::Drawing::Font ^ GetFont(System::Drawing::IDeviceContext ^ dc, System::Windows::Forms::VisualStyles::FontProperty prop);
public System.Drawing.Font GetFont(System.Drawing.IDeviceContext dc, System.Windows.Forms.VisualStyles.FontProperty prop);
public System.Drawing.Font? GetFont(System.Drawing.IDeviceContext dc, System.Windows.Forms.VisualStyles.FontProperty prop);
member this.GetFont : System.Drawing.IDeviceContext * System.Windows.Forms.VisualStyles.FontProperty -> System.Drawing.Font
Public Function GetFont (dc As IDeviceContext, prop As FontProperty) As Font

参数

dc
IDeviceContext

此操作 IDeviceContext 将使用。

prop
FontProperty

指定要 FontProperty 为当前视觉样式元素检索哪些属性值的值之一。

返回

包含由当前视觉样式元素的参数指定的Font属性值的 Aprop。

例外

dc 是 null。

prop 不是值 FontProperty 之一。

注解

视觉样式使用一组字体值来描述样式定义的元素的某些属性。 这些属性由 FontProperty 值封装。

适用于