StringFormatFlags 열거형

정의

텍스트 문자열의 표시 및 레이아웃 정보를 지정합니다.

이 열거형은 멤버 값의 비트 조합을 지원합니다.

public enum class StringFormatFlags
[System.Flags]
public enum StringFormatFlags
[<System.Flags>]
type StringFormatFlags = 
Public Enum StringFormatFlags
상속
StringFormatFlags
특성

필드

DirectionRightToLeft 1

텍스트가 오른쪽에서 왼쪽으로 표시됩니다.

DirectionVertical 2

텍스트가 세로로 맞춰집니다.

DisplayFormatControl 32

왼쪽에서 오른쪽으로 쓰기 표시와 같은 제어 문자가 해당 문자 모양으로 출력에 표시됩니다.

FitBlackBox 4

문자 일부가 문자열의 레이아웃 사각형에 걸칠 수 있습니다. 기본적으로는 문자가 걸치지 않게 위치가 조정됩니다.

LineLimit 8192

서식 지정 영역에서 전체 줄만 레이아웃됩니다. 기본적으로 다음 중 어느 경우가 먼저 발생하든 레이아웃은 텍스트 끝이나 클리핑의 결과로서 줄이 더 이상 보이지 않을 때까지 계속합니다. 기본 설정을 하면 서식 지정 영역이 줄 높이의 배수가 아니기 때문에 서식 지정 영역으로 마지막 줄이 부분적으로 불명확하게 됩니다. 전체 줄을 보려면, 이 값을 지정하고 높이가 최소한 한 줄만큼 되는 서식 지정 사각형을 제공하십시오.

MeasureTrailingSpaces 2048

각 줄의 끝에 후행 공백을 포함합니다. 기본적으로 MeasureString 메서드가 반환한 경계 사각형은 각 줄 끝의 공간을 제외합니다. 해당 공간을 포함할 이 플래그를 단위에 설정합니다.

NoClip 16384

문자 모양의 걸친 부분과 서식 지정 영역 밖에 도달하는 줄 바꿈되지 않은 텍스트를 볼 수 있습니다. 기본적으로 서식 지정 영역 밖에 도달하는 모든 텍스트와 문자 모양 부분은 클리핑됩니다.

NoFontFallback 1024

요청된 글꼴에서 지원되지 않는 문자를 대체 글꼴로 대체(fallback)하지 않습니다. 문자가 없는 경우 글꼴이 없다는 의미의 문자 모양(예: 대괄호([]))으로 표시됩니다.

NoWrap 4096

사각형 내에서 서식을 지정할 때 텍스트 줄 바꿈을 사용하지 않습니다. 사각형이 아니라 점이 전달되거나 지정된 사각형의 선 길이가 0일 때, 이 플래그가 적용됩니다.

예제

다음 코드 예제에서는 다음 멤버를 보여 줍니다.

이 예제는 Windows Forms 사용하도록 설계되었습니다. 폼에 코드를 붙여넣고 양식의 Paint 이벤트를 처리할 때 메서드를 호출 ShowLineAndAlignment 하여 로 PaintEventArgs전달 e 합니다.

private:
   void ShowLineAndAlignment( PaintEventArgs^ e )
   {
      // Construct a new Rectangle .
      Rectangle displayRectangle = Rectangle(Point(40,40),System::Drawing::Size( 80, 80 ));
      
      // Construct 2 new StringFormat objects
      StringFormat^ format1 = gcnew StringFormat( StringFormatFlags::NoClip );
      StringFormat^ format2 = gcnew StringFormat( format1 );
      
      // Set the LineAlignment and Alignment properties for
      // both StringFormat objects to different values.
      format1->LineAlignment = StringAlignment::Near;
      format1->Alignment = StringAlignment::Center;
      format2->LineAlignment = StringAlignment::Center;
      format2->Alignment = StringAlignment::Far;
      
      // Draw the bounding rectangle and a string for each
      // StringFormat object.
      e->Graphics->DrawRectangle( Pens::Black, displayRectangle );
      e->Graphics->DrawString( "Showing Format1", this->Font, Brushes::Red, displayRectangle, format1 );
      e->Graphics->DrawString( "Showing Format2", this->Font, Brushes::Red, displayRectangle, format2 );
   }
private void ShowLineAndAlignment(PaintEventArgs e)
{

    // Construct a new Rectangle .
    Rectangle  displayRectangle = 
        new Rectangle (new Point(40, 40), new Size (80, 80));

    // Construct 2 new StringFormat objects
    StringFormat format1 = new StringFormat(StringFormatFlags.NoClip);
    StringFormat format2 = new StringFormat(format1);

    // Set the LineAlignment and Alignment properties for
    // both StringFormat objects to different values.
    format1.LineAlignment = StringAlignment.Near;
    format1.Alignment = StringAlignment.Center;
    format2.LineAlignment = StringAlignment.Center;
    format2.Alignment = StringAlignment.Far;

    // Draw the bounding rectangle and a string for each
    // StringFormat object.
    e.Graphics.DrawRectangle(Pens.Black, displayRectangle);
    e.Graphics.DrawString("Showing Format1", this.Font, 
        Brushes.Red, (RectangleF)displayRectangle, format1);
    e.Graphics.DrawString("Showing Format2", this.Font, 
        Brushes.Red, (RectangleF)displayRectangle, format2);
}
Private Sub ShowLineAndAlignment(ByVal e As PaintEventArgs)

    ' Construct a new Rectangle.
    Dim displayRectangle _
        As New Rectangle(New Point(40, 40), New Size(80, 80))

    ' Construct two new StringFormat objects
    Dim format1 As New StringFormat(StringFormatFlags.NoClip)
    Dim format2 As New StringFormat(format1)

    ' Set the LineAlignment and Alignment properties for
    ' both StringFormat objects to different values.
    format1.LineAlignment = StringAlignment.Near
    format1.Alignment = StringAlignment.Center
    format2.LineAlignment = StringAlignment.Center
    format2.Alignment = StringAlignment.Far

    ' Draw the bounding rectangle and a string for each
    ' StringFormat object.
    e.Graphics.DrawRectangle(Pens.Black, displayRectangle)
    e.Graphics.DrawString("Showing Format1", Me.Font, Brushes.Red, _
        RectangleF.op_Implicit(displayRectangle), format1)
    e.Graphics.DrawString("Showing Format2", Me.Font, Brushes.Red, _
        RectangleF.op_Implicit(displayRectangle), format2)
End Sub

설명

StringFormatFlagsStringFormat 클래스에서 사용됩니다.

참고

FitBlackBox 필드의 이름이 잘못되었으며 해당 동작은 원래 GDI+ 구현의 필드와 유사 NoFitBlackBox 합니다.

적용 대상