DrawToolTipEventArgs.Font Propiedad

Definición

Obtiene la fuente usada para dibujar la 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

Valor de propiedad

Un objeto Font.

Ejemplos

En el ejemplo de código siguiente se muestra cómo dibujar personalizado .ToolTip En el ejemplo se crea y ToolTip se asocia a tres Button controles ubicados en .Form En el ejemplo se establece la OwnerDraw propiedad en true y se controla el Draw evento. En el Draw controlador de eventos, ToolTip el elemento se dibuja de forma diferente en función del botón para el ToolTip que se muestra como se indica en la DrawToolTipEventArgs.AssociatedControl propiedad .

El fragmento de código siguiente muestra el uso de los DrawBordermétodos , DrawBackgroundy DrawText . Consulte la información general de la DrawToolTipEventArgs clase para obtener el ejemplo de código 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

Comentarios

Use la Font propiedad cuando se crea un dibujo personalizado que ToolTip debe usar la fuente predeterminada de Windows.

Se aplica a

Consulte también