DataGridViewCell.MeasureTextHeight Método

Definición

Obtiene el alto, en píxeles, del texto especificado.

Sobrecargas

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

Obtiene el alto, en píxeles, del texto especificado, dadas las características especificadas. También indica si el ancho necesario es mayor que el ancho máximo especificado.

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

Obtiene el alto, en píxeles, del texto especificado, dadas las características especificadas.

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

Obtiene el alto, en píxeles, del texto especificado, dadas las características especificadas. También indica si el ancho necesario es mayor que el ancho máximo especificado.

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);
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

Parámetros

graphics
Graphics

Graphics que se usa para representar el texto.

text
String

Texto que se va a medir.

font
Font

Font Objeto aplicado al texto.

maxWidth
Int32

Ancho máximo del texto.

flags
TextFormatFlags

Combinación bit a bit de TextFormatFlags valores que se aplicarán al texto.

widthTruncated
Boolean

Establézcalo en true si el ancho necesario del texto es mayor que maxWidth.

Devoluciones

Alto, en píxeles, del texto.

Excepciones

graphics es null.

O bien

font es null.

maxWidth es menor que 1.

flags no es una combinación bit a bit válida de TextFormatFlags valores.

Comentarios

Si se requieren varias líneas y el formato especificado lo permite, el alto devuelto es el alto combinado de todas las líneas.

Consulte también

Se aplica a

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

Obtiene el alto, en píxeles, del texto especificado, dadas las características especificadas.

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);
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

Parámetros

graphics
Graphics

Graphics que se usa para representar el texto.

text
String

Texto que se va a medir.

font
Font

Font Objeto aplicado al texto.

maxWidth
Int32

Ancho máximo del texto.

flags
TextFormatFlags

Combinación bit a bit de TextFormatFlags valores que se aplicarán al texto.

Devoluciones

Alto, en píxeles, del texto.

Excepciones

graphics es null.

O bien

font es null.

maxWidth es menor que 1.

flags no es una combinación bit a bit válida de TextFormatFlags valores.

Comentarios

Si se requieren varias líneas y el formato especificado lo permite, el alto devuelto es el alto combinado de todas las líneas.

Consulte también

Se aplica a