TextFormatFlags 열거형
정의
텍스트 문자열의 표시 및 레이아웃 정보를 지정합니다.Specifies the display and layout information for text strings.
이 열거형에는 멤버 값의 비트 조합을 허용하는 FlagsAttribute 특성이 있습니다.
public enum class TextFormatFlags
[System.Flags]
public enum TextFormatFlags
[<System.Flags>]
type TextFormatFlags =
Public Enum TextFormatFlags
- 상속
- 특성
필드
Bottom | 8 | 경계 사각형의 아래쪽에 텍스트를 맞춥니다.Aligns the text on the bottom of the bounding rectangle. 텍스트가 한 줄인 경우에만 적용됩니다.Applied only when the text is a single line. |
Default | 0 | 왼쪽 맞춤인 기본 서식을 적용합니다.Applies the default formatting, which is left-aligned. |
EndEllipsis | 32768 | 트리밍된 줄의 끝을 제거하고 줄임표로 바꿉니다.Removes the end of trimmed lines, and replaces them with an ellipsis. |
ExpandTabs | 64 | 탭 문자를 확장합니다.Expands tab characters. 탭당 기본 문자 수는 8개입니다.The default number of characters per tab is eight. WordEllipsis, PathEllipsis 및 EndEllipsis 값은 ExpandTabs에서 사용할 수 없습니다.The WordEllipsis, PathEllipsis, and EndEllipsis values cannot be used with ExpandTabs. |
ExternalLeading | 512 | 줄 높이에 글꼴에 대한 추가 세로 공간을 포함시킵니다.Includes the font external leading in line height. 일반적으로 추가 세로 공간은 텍스트 줄의 높이에 포함되지 않습니다.Typically, external leading is not included in the height of a line of text. |
GlyphOverhangPadding | 0 | 걸친 모양의 문자를 표시하기 위해 경계 사각형에 여백을 추가합니다.Adds padding to the bounding rectangle to accommodate overhanging glyphs. 이것이 기본값입니다.This is the default. |
HidePrefix | 1048576 | 뒤에 오는 문자에 밑줄이 표시되지 않도록 텍스트의 앰퍼샌드(&) 접두사를 무시합니다. 그러나 다른 니모닉 접두사는 여전히 처리됩니다.Ignores the ampersand (&) prefix character in the text, so that the letter that follows won't be underlined, but other mnemonic-prefix characters are still processed. |
HorizontalCenter | 1 | 경계 사각형 안에서 텍스트를 가로 방향으로 가운데에 맞춥니다.Centers the text horizontally within the bounding rectangle. |
Internal | 4096 | 시스템 글꼴을 사용하여 텍스트 메트릭을 계산합니다.Uses the system font to calculate text metrics. |
Left | 0 | 클리핑 영역의 왼쪽에 텍스트를 맞춥니다.Aligns the text on the left side of the clipping area. 이것이 기본값입니다.This is the default. |
LeftAndRightPadding | 536870912 | 경계 사각형의 양쪽에 여백을 추가합니다.Adds padding to both sides of the bounding rectangle. |
ModifyString | 65536 | 그려진 텍스트나 텍스트 측정에 영향을 주지 않습니다.Has no effect on the drawn text or text measurements. |
NoClipping | 256 | 문자의 걸친 부분과 서식 지정 영역을 벗어나는 줄 바꿈되지 않은 텍스트가 표시되도록 합니다.Allows the overhanging parts of glyphs and unwrapped text reaching outside the formatting rectangle to show. |
NoFullWidthCharacterBreak | 524288 | 영향을 주지 않는 레거시 값입니다.A legacy value that has no effect. 줄 바꿈 규칙이 싱글 와이드 문자 문자열과 동일하도록 더블 와이드 문자 문자열에서 줄 바꿈을 차단합니다.It prevents a line break at a double-wide character string, so that the line-breaking rule is equivalent to that for single-wide character strings. |
NoPadding | 268435456 | 경계 사각형에 여백을 추가하지 않습니다.Does not add padding to the bounding rectangle. |
NoPrefix | 2048 | 접두사 처리를 해제합니다.Turns off processing of prefix characters. 일반적으로 앰퍼샌드(&) 니모닉 접두사 문자는 다음 문자에 밑줄을 치는 지시문으로 해석되고, 이중 앰퍼샌드(&&) 니모닉 접두사 문자는 단일 앰퍼샌드를 인쇄하는 지시문으로 해석됩니다.Typically, the ampersand (&) mnemonic-prefix character is interpreted as a directive to underscore the character that follows, and the double-ampersand (&&) mnemonic-prefix characters as a directive to print a single ampersand. NoPrefix를 지정하면 이 처리가 해제됩니다.By specifying NoPrefix, this processing is turned off. 예를 들어 NoPrefix를 적용한 "A&bc&&d"라는 입력 문자열은 "A&bc&&d"를 출력합니다.For example, an input string of "A&bc&&d" with NoPrefix applied would result in output of "A&bc&&d". |
PathEllipsis | 16384 | 트리밍된 줄의 가운데 부분을 제거하고 줄임표로 바꿉니다.Removes the center of trimmed lines and replaces it with an ellipsis. |
PrefixOnly | 2097152 | 앰퍼샌드(&) 접두사 뒤에 오는 문자 위치에만 밑줄을 그리며 문자열의 다른 문자에는 밑줄을 그리지 않습니다.Draws only an underline at the position of the character following the ampersand (&) prefix character and doesn't draw any other characters in the string. |
PreserveGraphicsClipping | 16777216 | Graphics 개체에서 지정하는 클리핑을 유지합니다.Preserves the clipping specified by a Graphics object. IDeviceContext인 Graphics를 받는 메서드에만 적용됩니다.Applies only to methods receiving an IDeviceContext that is a Graphics. |
PreserveGraphicsTranslateTransform | 33554432 | Graphics에서 지정하는 변환을 유지합니다.Preserves the transformation specified by a Graphics. IDeviceContext인 Graphics를 받는 메서드에만 적용됩니다.Applies only to methods receiving an IDeviceContext that is a Graphics. |
Right | 2 | 클리핑 영역의 오른쪽에 텍스트를 맞춥니다.Aligns the text on the right side of the clipping area. |
RightToLeft | 131072 | 오른쪽에서 왼쪽으로 텍스트를 표시합니다.Displays the text from right to left. |
SingleLine | 32 | 텍스트를 한 줄에 표시합니다.Displays the text in a single line. |
TextBoxControl | 8192 | TextBox 컨트롤에 표시하기 위해 텍스트의 서식을 지정하도록 나타냅니다.Specifies the text should be formatted for display on a TextBox control. |
Top | 0 | 경계 사각형의 위쪽에 텍스트를 맞춥니다.Aligns the text on the top of the bounding rectangle. 이것이 기본값입니다.This is the default. |
VerticalCenter | 4 | 경계 사각형 안에서 텍스트를 세로 방향으로 가운데에 맞춥니다.Centers the text vertically, within the bounding rectangle. |
WordBreak | 16 | 단어 끝에서 텍스트의 줄을 바꿉니다.Breaks the text at the end of a word. |
WordEllipsis | 262144 | 가장 가까운 단어에서 줄을 트리밍하고 트리밍된 줄 끝에 줄임표를 배치합니다.Trims the line to the nearest word and an ellipsis is placed at the end of a trimmed line. EndEllipsis와 PathEllipsis를 비교합니다.Compare with EndEllipsis and PathEllipsis. |
예제
다음 예제에서는 열거형을 사용 하는 방법을 보여 줍니다 TextFormatFlags
.The following example demonstrates how to use the TextFormatFlags
enumeration. 이 예제를 실행 하려면 Windows 폼에 다음 코드를 붙여 넣습니다.To run this example, paste the following code into a Windows Form. 호출 RenderText6
에서 양식의 Paint 이벤트 처리기를 전달 e
으로 PaintEventArgs입니다.Call RenderText6
from the form's Paint event handler, passing e
as PaintEventArgs.
private void RenderText6(PaintEventArgs e)
{
TextFormatFlags flags = TextFormatFlags.Bottom | TextFormatFlags.EndEllipsis;
TextRenderer.DrawText(e.Graphics, "This is some text that will be clipped at the end.", this.Font,
new Rectangle(10, 10, 100, 50), SystemColors.ControlText, flags);
}
Private Sub RenderText6(ByVal e As PaintEventArgs)
Dim flags As TextFormatFlags = TextFormatFlags.Bottom Or _
TextFormatFlags.EndEllipsis
TextRenderer.DrawText(e.Graphics, _
"This is some text that will be clipped at the end.", _
Me.Font, New Rectangle(10, 10, 100, 50), SystemColors.ControlText, flags)
End Sub
설명
합니다 TextFormatFlags
열거형에서 사용 되는 TextRenderer 그리고 텍스트를 측정 하는 경우.The TextFormatFlags
enumeration is used by the TextRenderer when drawing and measuring text. 합니다 TextRenderer 사용을 중지할 기존 탭을 확장할 수 있지만 그린된 텍스트에 탭 정지를 추가 하는 지원 하지 않습니다는 ExpandTabs
플래그입니다.The TextRenderer does not support adding tab stops to drawn text, although you can expand existing tab stops using the ExpandTabs
flag.