DataGridViewCell.MeasureTextSize 메서드

정의

지정된 특성이 주어진 경우 지정된 텍스트의 높이와 너비를 가져옵니다.

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

매개 변수

graphics
Graphics

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

text
String

측정할 텍스트입니다.

font
Font

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

flags
TextFormatFlags

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

반환

Size

텍스트의 높이와 너비를 나타내는 Size입니다.

예외

graphics이(가) null인 경우

또는 font이(가) null인 경우

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

설명

여러 줄이 필요하고 지정된 서식 지정이 허용되는 경우 반환되는 크기에는 모든 줄의 결합된 높이가 포함됩니다.

적용 대상

추가 정보