DataGridViewCell.MeasureTextHeight 메서드

정의

지정된 텍스트의 높이(픽셀)를 가져옵니다.

오버로드

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

지정된 특성이 주어진 경우 지정된 텍스트의 높이(픽셀)를 가져옵니다. 필요한 너비가 지정된 최대 너비보다 큰지 여부도 나타냅니다.

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

지정된 특성이 주어진 경우 지정된 텍스트의 높이(픽셀)를 가져옵니다.

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

지정된 특성이 주어진 경우 지정된 텍스트의 높이(픽셀)를 가져옵니다. 필요한 너비가 지정된 최대 너비보다 큰지 여부도 나타냅니다.

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

매개 변수

graphics
Graphics

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

text
String

측정할 텍스트입니다.

font
Font

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

maxWidth
Int32

텍스트의 최대 너비입니다.

flags
TextFormatFlags

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

widthTruncated
Boolean

텍스트의 요청된 너비가 maxWidth보다 크면 true로 설정합니다.

반환

Int32

텍스트의 높이(픽셀)입니다.

예외

graphics이(가) null인 경우

또는 font이(가) null인 경우

maxWidth 가 1보다 작습니다.

flagsTextFormatFlags 값의 유효한 비트 조합이 아닙니다.

설명

여러 줄이 필요하고 지정된 서식 지정이 허용되면 반환되는 높이가 모든 줄의 결합된 높이입니다.

추가 정보

적용 대상

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

지정된 특성이 주어진 경우 지정된 텍스트의 높이(픽셀)를 가져옵니다.

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

매개 변수

graphics
Graphics

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

text
String

측정할 텍스트입니다.

font
Font

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

maxWidth
Int32

텍스트의 최대 너비입니다.

flags
TextFormatFlags

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

반환

Int32

텍스트의 높이(픽셀)입니다.

예외

graphics이(가) null인 경우

또는 font이(가) null인 경우

maxWidth 가 1보다 작습니다.

flagsTextFormatFlags 값의 유효한 비트 조합이 아닙니다.

설명

여러 줄이 필요하고 지정된 서식 지정이 허용되면 반환되는 높이가 모든 줄의 결합된 높이입니다.

추가 정보

적용 대상