DataGridViewCell.MeasureTextSize Metoda

Definice

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

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

Parametry

graphics
Graphics

Použitý Graphics k vykreslení textu.

text
String

Text, který chcete měřit.

font
Font

Použitý Font u textu.

flags
TextFormatFlags

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

Návraty

Size

Představuje Size výšku a šířku textu.

Výjimky

graphics je null.

-nebo- font je null.

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, bude vrácená velikost obsahovat kombinovanou výšku všech řádků.

Platí pro

Viz také