RichTextBoxFinds 列挙体とは? わかりやすく解説

RichTextBoxFinds 列挙体

RichTextBox コントロール文字列検索実行する方法指定します

この列挙体には、メンバ値のビットごとの組み合わせ可能にする FlagsAttribute 属性含まれています。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

<FlagsAttribute> _
Public Enumeration RichTextBoxFinds
Dim instance As RichTextBoxFinds
[FlagsAttribute] 
public enum RichTextBoxFinds
[FlagsAttribute] 
public enum class RichTextBoxFinds
/** @attribute FlagsAttribute() */ 
public enum RichTextBoxFinds
FlagsAttribute 
public enum RichTextBoxFinds
メンバメンバ
解説解説
使用例使用例

RichTextBox内容全体文字列検索し最初に見つかった文字列メソッドテキスト パラメータに渡す例を次に示します検索開始位置は、メソッドstart パラメータ指定しますRichTextBoxで検索文字列が見つかると、見つかったテキスト最初文字インデックス位置返され見つかったテキスト強調表示されます。それ以外場合は -1 の値が返されます。この例では、指定した検索文字列大文字と小文字一致させる検索オプション指定されています。この例は、このメソッドrichTextBox1 という名前の RichTextBox保持する Formクラス内にあることを前提にしています。この例を使用して検索テキスト最初インスタンス見つかったら、"Find Next" 入力操作実行して、そのテキストのほかのインスタンス検索できます

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

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 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.get_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;
} //FindMyText
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

RichTextBoxFinds 列挙体のお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



RichTextBoxFinds 列挙体のページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS