DrawToolTipEventArgs.Font Proprietà

Definizione

Ottiene il tipo di carattere utilizzato per creare l'oggetto 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

Valore della proprietà

Un oggetto Font.

Esempio

Nell'esempio di codice seguente viene illustrato come disegnare l'oggetto ToolTippersonalizzato. L'esempio crea un oggetto ToolTip e lo associa a tre Button controlli che si trovano nell'oggetto Form. Nell'esempio la OwnerDraw proprietà viene impostata su true e viene gestito l'evento Draw . Draw Nel gestore eventi, l'oggetto ToolTip viene disegnato in modo diverso a seconda del pulsante ToolTip per cui viene visualizzato come indicato dalla DrawToolTipEventArgs.AssociatedControl proprietà .

L'estratto di codice riportato di seguito illustra l'uso dei DrawBordermetodi , DrawBackgrounde DrawText . Vedere la panoramica della DrawToolTipEventArgs classe per l'esempio di codice completo.

// 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

Commenti

Utilizzare la Font proprietà quando si crea un oggetto ToolTip personalizzato che deve utilizzare il tipo di carattere predefinito di Windows.

Si applica a

Vedi anche