FontFamily.GetCellDescent(FontStyle) メソッド

定義

指定したスタイルの FontFamily のセル ディセントをデザイン単位で返します。

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

パラメーター

style
FontStyle

フォントのスタイル情報が格納されている FontStyle

戻り値

指定した FontFamily を使用するこの FontStyle のセル ディセント メトリック。

次のコード例は、Windows フォームで使用するように設計されており、イベント ハンドラーのPaintパラメーターである が必要PaintEventArgseです。 コードは、次のアクションを実行します。

  • FontFamily を作成します。

  • そのフォント ファミリのセル降下を取得します。

  • セル降下の値をテキストとして画面に描画します。

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

適用対象

こちらもご覧ください