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);
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 값의 비트 조합입니다.

반환

Int32

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

예외

graphics이(가) null인 경우

또는 font이(가) null인 경우

maxHeight 가 1보다 작습니다.

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

적용 대상

추가 정보