RichTextBoxFinds 열거형

정의

RichTextBox 컨트롤에서 텍스트 검색이 수행되는 방식을 지정합니다.

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

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

필드

MatchCase 4

대/소문자가 일치하는 검색 텍스트만 찾습니다.

NoHighlight 8

검색 텍스트를 찾은 경우 강조 표시되면 안됩니다.

None 0

검색에서 찾은 결과가 단어 단위로 검색되었는지 여부에 관계 없이 모든 결과를 찾습니다.

Reverse 16

컨트롤의 문서 끝에서 검색을 시작하여 문서의 시작까지 검색합니다.

WholeWord 2

단어 단위로 일치하는 검색 텍스트만 찾습니다.

예제

다음 예제에서는 검색의 전체 내용을 RichTextBox 메서드의 텍스트 매개 변수에 전달 된 첫 번째 인스턴스의 검색 문자열입니다. 검색 시작 위치는 메서드의 시작 매개 변수에 의해 지정 됩니다. 검색 문자열에 있으면는 RichTextBox, 그렇지 않으면-1 값을 반환 합니다; 메서드는 검색된 된 텍스트의 첫 번째 문자의 인덱스 위치를 반환 하 고 찾은 텍스트를 강조 표시 합니다. 또한이 예제에서는 지정 된 검색 문자열의 대/소문자 구분 검색의 옵션을 지정 합니다. 이 예제에서는이 메서드가의 클래스에 포함 되어 있는지 가정를 Form 포함 된를 RichTextBox 라는 richTextBox1. 이 예제에서는 텍스트의 다른 인스턴스를 찾으려면 검색 텍스트의 첫 번째 인스턴스를 찾은 다음 찾기 "형식 작업을 수행할 때 사용할 수 있습니다.

public:
   int FindMyText( String^ text, int start )
   {
      // Initialize the return value to false by default.
      int returnValue = -1;
      
      // Ensure that a search string has been specified and a valid start point.
      if ( text->Length > 0 && start >= 0 )
      {
         // Obtain the location of the search string in richTextBox1.
         int indexToText = richTextBox1->Find( text, start, RichTextBoxFinds::MatchCase );
         // Determine whether the text was found in richTextBox1.
         if ( indexToText >= 0 )
         {
            returnValue = indexToText;
         }
      }

      return returnValue;
   }
public int FindMyText(string text, int start)
{
   // Initialize the return value to false by default.
   int returnValue = -1;

   // Ensure that a search string has been specified and a valid start point.
   if (text.Length > 0 && start >= 0) 
   {
      // Obtain the location of the search string in richTextBox1.
      int indexToText = richTextBox1.Find(text, start, RichTextBoxFinds.MatchCase);
      // Determine whether the text was found in richTextBox1.
      if(indexToText >= 0)
      {
         returnValue = indexToText;
      }
   }

   return returnValue;
}
Public Function FindMyText(text As String, start As Integer) As Integer
    ' Initialize the return value to false by default.
    Dim returnValue As Integer = - 1
    
    ' Ensure that a search string has been specified and a valid start point.
    If text.Length > 0 And start >= 0 Then
        ' Obtain the location of the search string in richTextBox1.
        Dim indexToText As Integer = richTextBox1.Find(text, start, _
            RichTextBoxFinds.MatchCase)
        ' Determine whether the text was found in richTextBox1.
        If indexToText >= 0 Then
            returnValue = indexToText
        End If
    End If
    
    Return returnValue
End Function

설명

애플리케이션에서 텍스트를 찾습니다는 RichTextBox 호출 하 여 컨트롤을 Find 메서드의 RichTextBox 컨트롤입니다. 이 열거형을 사용 하면 검색이 수행 되는 방법을 지정할 수 있습니다 때는 Find 메서드가 호출 됩니다. 호출 하는 경우 둘 이상의 검색 옵션을 지정 하려면이 열거형의 하나 이상의 값을 결합할 수 있습니다는 Find 메서드.

적용 대상

추가 정보