DataGridViewCell.MeasureTextPreferredSize Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém a altura e a largura ideal do texto especificado, dadas as características indicadas.
public:
static System::Drawing::Size MeasureTextPreferredSize(System::Drawing::Graphics ^ graphics, System::String ^ text, System::Drawing::Font ^ font, float maxRatio, System::Windows::Forms::TextFormatFlags flags);
public static System.Drawing.Size MeasureTextPreferredSize (System.Drawing.Graphics graphics, string text, System.Drawing.Font font, float maxRatio, System.Windows.Forms.TextFormatFlags flags);
static member MeasureTextPreferredSize : System.Drawing.Graphics * string * System.Drawing.Font * single * System.Windows.Forms.TextFormatFlags -> System.Drawing.Size
Public Shared Function MeasureTextPreferredSize (graphics As Graphics, text As String, font As Font, maxRatio As Single, flags As TextFormatFlags) As Size
Parâmetros
- text
- String
O texto a ser medido.
- maxRatio
- Single
A proporção máxima de largura para altura do bloco de texto.
- flags
- TextFormatFlags
Uma combinação bit a bit de TextFormatFlags valores a serem aplicados ao texto.
Retornos
Um Size que representa a altura e a largura preferencial do texto.
Exceções
maxRatio
é menor ou igual a 0.
flags
não é uma combinação bit a bit válida de valores de TextFormatFlags.
Comentários
Se várias linhas forem necessárias e a formatação especificada permitir, o tamanho retornado incluirá a altura combinada de todas as linhas.