FontFamily.GetCellDescent(FontStyle) Método

Definición

Devuelve el descenso de celda, en unidades de diseño, del objeto FontFamily del estilo especificado.

public:
 int GetCellDescent(System::Drawing::FontStyle style);
public int GetCellDescent (System.Drawing.FontStyle style);
member this.GetCellDescent : System.Drawing.FontStyle -> int
Public Function GetCellDescent (style As FontStyle) As Integer

Parámetros

style
FontStyle

FontStyle que contiene la información de estilo de la fuente.

Devoluciones

Medida del descenso de celda de este objeto FontFamily que usa la enumeración FontStyle especificada.

Ejemplos

El ejemplo de código siguiente está diseñado para su uso con Windows Forms y requiere PaintEventArgse, que es un parámetro del Paint controlador de eventos. El código realiza las siguientes acciones:

  • Crea una interfaz FontFamily.

  • Obtiene el descenso de celda para esa familia de fuentes.

  • Dibuja el valor del descenso de celda en la pantalla como texto.

public:
   void GetCellDescent_Example( PaintEventArgs^ e )
   {
      // Create a FontFamily object.
      FontFamily^ descentFontFamily = gcnew FontFamily( "arial" );

      // Get the cell descent of the font family in design units.
      int cellDescent = descentFontFamily->GetCellDescent( FontStyle::Regular );

      // Draw the result as a string to the screen.
      e->Graphics->DrawString( String::Format( "descentFontFamily.GetCellDescent() returns {0}.", cellDescent ),
            gcnew System::Drawing::Font( descentFontFamily,16 ), Brushes::Black, PointF(0,0) );
   }
public void GetCellDescent_Example(PaintEventArgs e)
{
    // Create a FontFamily object.
    FontFamily descentFontFamily = new FontFamily("arial");
             
    // Get the cell descent of the font family in design units.
    int cellDescent = descentFontFamily.GetCellDescent(FontStyle.Regular);
             
    // Draw the result as a string to the screen.
    e.Graphics.DrawString(
        "descentFontFamily.GetCellDescent() returns " + cellDescent.ToString() + ".",
        new Font(descentFontFamily, 16),
        Brushes.Black,
        new PointF(0, 0));
}
Public Sub GetCellDescent_Example(ByVal e As PaintEventArgs)

    ' Create a FontFamily object.
    Dim descentFontFamily As New FontFamily("arial")

    ' Get the cell descent of the font family in design units.
    Dim cellDescent As Integer = _
    descentFontFamily.GetCellDescent(FontStyle.Regular)

    ' Draw the result as a string to the screen.
    e.Graphics.DrawString("descentFontFamily.GetCellDescent() returns " _
    & cellDescent.ToString() & ".", New Font(descentFontFamily, 16), _
    Brushes.Black, New PointF(0, 0))
End Sub

Se aplica a

Consulte también