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

Font,包含由目前視覺化樣式項目 prop 參數所指定的屬性值。

例外狀況

dcnull

prop 不是其中一個 FontProperty 值。

備註

視覺化樣式會使用一組字型值來描述樣式所定義之元素的某些屬性。 這些屬性會由 FontProperty 值封裝。

適用於