언어

DataGridViewCell.MeasureTextWidth 메서드

정의

지정된 특성이 지정된 경우 지정된 텍스트의 너비(픽셀)를 가져옵니다.

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

매개 변수

graphics
Graphics

Graphics 텍스트를 렌더링하는 데 사용되는 형식입니다.

text
String

측정할 텍스트입니다.

font
Font

Font 텍스트에 적용된 것입니다.

maxHeight
Int32

텍스트의 최대 높이입니다.

flags
TextFormatFlags

텍스트에 적용할 값의 TextFormatFlags 비트 조합입니다.

반품

텍스트의 너비(픽셀)입니다.

예외

graphics은 null입니다.

-또는-

font은 null입니다.

maxHeight 가 1보다 작습니다.

flags 은 값의 유효한 비트 조합이 TextFormatFlags 아닙니다.

적용 대상

참고 항목