DataGridViewCell.MeasureTextHeight Metoda

Definice

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

Přetížení

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

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

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

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

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

Zdroj:
DataGridViewCell.cs
Zdroj:
DataGridViewCell.cs
Zdroj:
DataGridViewCell.cs
Zdroj:
DataGridViewCell.cs
Zdroj:
DataGridViewCell.cs

Získá výšku v pixelech zadaného textu vzhledem k zadaným charakteristikám. Určuje také, jestli 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 měřit.

font
Font

Použité Font u textu.

maxWidth
Int32

Maximální šířka textu.

flags
TextFormatFlags

Bitové kombinace TextFormatFlags hodnot, které se mají použít u textu.

widthTruncated
Boolean

Nastavte, 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, je vrácená výška kombinovanou výškou všech řádků.

Viz také

Platí pro

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

Zdroj:
DataGridViewCell.cs
Zdroj:
DataGridViewCell.cs
Zdroj:
DataGridViewCell.cs
Zdroj:
DataGridViewCell.cs
Zdroj:
DataGridViewCell.cs

Získá výšku v pixelech zadaného textu 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 měřit.

font
Font

Použité Font u textu.

maxWidth
Int32

Maximální šířka textu.

flags
TextFormatFlags

Bitové kombinace TextFormatFlags hodnot, které se mají použít u textu.

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, je vrácená výška kombinovanou výškou všech řádků.

Viz také

Platí pro