RichTextBox.ZoomFactor 속성

정의

RichTextBox의 현재 확대/축소 수준을 가져오거나 설정합니다.

public:
 property float ZoomFactor { float get(); void set(float value); };
public float ZoomFactor { get; set; }
member this.ZoomFactor : single with get, set
Public Property ZoomFactor As Single

속성 값

Single

컨트롤의 내용이 확대/축소되는 비율입니다.

예외

지정된 확대/축소 비율이 허용 범위에 속하지 않는 경우

예제

다음 코드 예제에서는 텍스트를 확대하고, 단어를 두 번 클릭할 때 컨트롤 텍스트에서 단어를 자동으로 선택하고, 컨트롤의 클라이언트 영역 오른쪽에 여백이 있는 단어를 만드는 RichTextBox 방법을 보여 줍니다. 컨트롤의 RichTextBox 너비가 작으면 이 코드를 사용하면 텍스트의 각 문자가 자체 줄에 표시되는 위치가 만들어집니다 RichTextBox . 이 세로 표시 위치에 있는 동안 단어의 모든 부분을 클릭하면 텍스트가 세로로 표시되는 사실에 관계없이 단어의 모든 문자가 선택됩니다. 이 예제에서는 명명richTextBox1된 컨트롤이 포함된 폼이 RichTextBox 있어야 합니다.

private:
   void ZoomMyRichTextBox()
   {
      // Enable users to select entire word when double clicked.
      richTextBox1->AutoWordSelection = true;

      // Clear contents of control.
      richTextBox1->Clear();

      // Set the right margin to restrict horizontal text.
      richTextBox1->RightMargin = 2;

      // Set the text for the control.
      richTextBox1->SelectedText = "Alpha Bravo Charlie Delta Echo Foxtrot";

      // Zoom by 2 points.
      richTextBox1->ZoomFactor = 2.0f;
   }
private void ZoomMyRichTextBox()
{
    // Enable users to select entire word when double clicked.
    richTextBox1.AutoWordSelection = true;
    // Clear contents of control.
    richTextBox1.Clear();
    // Set the right margin to restrict horizontal text.
    richTextBox1.RightMargin = 2;
    // Set the text for the control.
    richTextBox1.SelectedText = "Alpha Bravo Charlie Delta Echo Foxtrot";
    // Zoom by 2 points.
    richTextBox1.ZoomFactor = 2.0f;
}
Private Sub ZoomMyRichTextBox()
    ' Enable users to select entire word when double clicked.
    richTextBox1.AutoWordSelection = True
    ' Clear contents of control.
    richTextBox1.Clear()
    ' Set the right margin to restrict horizontal text.
    richTextBox1.RightMargin = 2
    ' Set the text for the control.
    richTextBox1.SelectedText = "Alpha Bravo Charlie Delta Echo Foxtrot"
    ' Zoom by 2 points.
    richTextBox1.ZoomFactor = 2.0F
End Sub

설명

이 속성의 값은 1/64(0.015625)에서 64.0 사이일 수 있으며 포함할 수 없습니다. 값이 1.0이면 컨트롤에 확대/축소가 적용되지 않음을 나타냅니다. 확대/축소 기능은 문서에 TrueType 글꼴이 포함된 경우 최적으로 수행됩니다. 컨트롤의 문서 내에서 TrueType이 아닌 글꼴을 사용하는 경우 속성은 ZoomFactor 가장 가까운 정수 값을 사용합니다. 이 속성을 사용하면 컨트롤 사용자가 RichTextBox 보기에 너무 작은 설명서의 섹션을 확대하거나 화면을 더 많이 볼 수 있도록 보기를 압축할 수 있습니다.

적용 대상