DataGridViewCell.MeasureTextHeight Metoda

Definice

Získá výšku zadaného textu v pixelech.

Přetížení

MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags, Boolean)

Získá výšku zadaného textu v pixelech vzhledem k zadaným charakteristikám. Označuje také, zda je požadovaná šířka větší než zadaná maximální šířka.

MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags)

Získá výšku zadaného textu v pixelech vzhledem k zadaným charakteristikám.

MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags, Boolean)

Získá výšku zadaného textu v pixelech vzhledem k zadaným charakteristikám. Označuje také, zda je požadovaná šířka větší než zadaná maximální šířka.

public:
 static int MeasureTextHeight(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, int maxWidth, System::Windows::Forms::TextFormatFlags flags, [Runtime::InteropServices::Out] bool % widthTruncated);
public static int MeasureTextHeight (System.Drawing.Graphics graphics, string text, System.Drawing.Font font, int maxWidth, System.Windows.Forms.TextFormatFlags flags, out bool widthTruncated);
public static int MeasureTextHeight (System.Drawing.Graphics graphics, string? text, System.Drawing.Font font, int maxWidth, System.Windows.Forms.TextFormatFlags flags, out bool widthTruncated);
static member MeasureTextHeight : System.Drawing.Graphics * string * System.Drawing.Font * int * System.Windows.Forms.TextFormatFlags * bool -> int
Public Shared Function MeasureTextHeight (graphics As Graphics, text As String, font As Font, maxWidth As Integer, flags As TextFormatFlags, ByRef widthTruncated As Boolean) As Integer

Parametry

graphics
Graphics

Slouží Graphics k vykreslení textu.

text
String

Text, který chcete změřit.

font
Font

Hodnota použitá Font pro text.

maxWidth
Int32

Maximální šířka textu.

flags
TextFormatFlags

Bitové kombinace TextFormatFlags hodnot, které se mají použít pro text.

widthTruncated
Boolean

Nastavte na hodnotu true , pokud je požadovaná šířka textu větší než maxWidth.

Návraty

Výška textu v pixelech.

Výjimky

graphics je null.

-nebo-

font je null.

maxWidth je menší než 1.

flags není platná bitové kombinace TextFormatFlags hodnot.

Poznámky

Pokud je vyžadováno více řádků a zadané formátování to umožňuje, vrácená výška je kombinovaná výška všech čar.

Viz také

Platí pro

MeasureTextHeight(Graphics, String, Font, Int32, TextFormatFlags)

Získá výšku zadaného textu v pixelech vzhledem k zadaným charakteristikám.

public:
 static int MeasureTextHeight(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, int maxWidth, System::Windows::Forms::TextFormatFlags flags);
public static int MeasureTextHeight (System.Drawing.Graphics graphics, string text, System.Drawing.Font font, int maxWidth, System.Windows.Forms.TextFormatFlags flags);
public static int MeasureTextHeight (System.Drawing.Graphics graphics, string? text, System.Drawing.Font font, int maxWidth, System.Windows.Forms.TextFormatFlags flags);
static member MeasureTextHeight : System.Drawing.Graphics * string * System.Drawing.Font * int * System.Windows.Forms.TextFormatFlags -> int
Public Shared Function MeasureTextHeight (graphics As Graphics, text As String, font As Font, maxWidth As Integer, flags As TextFormatFlags) As Integer

Parametry

graphics
Graphics

Slouží Graphics k vykreslení textu.

text
String

Text, který chcete změřit.

font
Font

Hodnota použitá Font pro text.

maxWidth
Int32

Maximální šířka textu.

flags
TextFormatFlags

Bitové kombinace TextFormatFlags hodnot, které se mají použít pro text.

Návraty

Výška textu v pixelech.

Výjimky

graphics je null.

-nebo-

font je null.

maxWidth je menší než 1.

flags není platná bitové kombinace TextFormatFlags hodnot.

Poznámky

Pokud je vyžadováno více řádků a zadané formátování to umožňuje, vrácená výška je kombinovaná výška všech čar.

Viz také

Platí pro