다음을 통해 공유


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

속성 값

컨트롤의 내용을 확대/축소하는 요소입니다.

예외

지정한 확대/축소 인수가 허용 범위 내에 속하지 않았습니다.

예제

다음 코드 예제에서는 텍스트를 확대하고, 단어를 두 번 클릭할 때 컨트롤 텍스트에서 단어를 자동으로 선택하고, 컨트롤의 클라이언트 영역 오른쪽에 여백이 있는 단어를 만드는 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 사용자가 보기에 너무 작은 설명서의 섹션을 확대 하거나 화면에서 더 많은 문서를 볼 수 있도록 뷰를 압축할 수 있습니다.

적용 대상