DrawToolTipEventArgs.Font 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得用來繪製 ToolTip.
public:
property System::Drawing::Font ^ Font { System::Drawing::Font ^ get(); };
public System.Drawing.Font Font { get; }
public System.Drawing.Font? Font { get; }
member this.Font : System.Drawing.Font
Public ReadOnly Property Font As Font
屬性值
Font 物件。
範例
以下程式碼範例示範如何自訂繪製 ToolTip。 範例中建立 aToolTip,並將其關聯到位於 的Form三個Button控制項。 範例中將屬性OwnerDraw設為 true,並處理事件。Draw 在Draw事件處理器中,根據屬性所示DrawToolTipEventArgs.AssociatedControl顯示的按鈕ToolTip,會ToolTip自訂繪製不同方式。
以下程式碼摘錄展示了使用 DrawBorder、 DrawBackground和 DrawText 方法的使用。 完整程式碼範例請參閱 DrawToolTipEventArgs 課程概述。
// Draw the ToolTip using default values if the ToolTip is for button3.
else if ( e->AssociatedControl == button3 )
{
e->DrawBackground();
e->DrawBorder();
e->DrawText();
}
// Draw the ToolTip using default values if the ToolTip is for button3.
else if (e.AssociatedControl == button3)
{
e.DrawBackground();
e.DrawBorder();
e.DrawText();
}
ElseIf (e.AssociatedControl Is button3) Then
' Draw the ToolTip using default values if the ToolTip is for button3.
e.DrawBackground()
e.DrawBorder()
e.DrawText()
End If
備註
當你自訂繪製 A ToolTip 時,可以使用Font應該使用 Windows 預設字型的屬性。