RichTextBox.SelectionProtected プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > RichTextBox.SelectionProtected プロパティの意味・解説 

RichTextBox.SelectionProtected プロパティ

現在選択されているテキスト保護されているかどうかを示す値を取得または設定します

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

Public Property SelectionProtected As
 Boolean
Dim instance As RichTextBox
Dim value As Boolean

value = instance.SelectionProtected

instance.SelectionProtected = value
public bool SelectionProtected { get;
 set; }
public:
property bool SelectionProtected {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_SelectionProtected ()

/** @property */
public void set_SelectionProtected (boolean
 value)
public function get SelectionProtected
 () : boolean

public function set SelectionProtected
 (value : boolean)

プロパティ
現在の選択内容に対して変更を行うことができない場合trueそれ以外場合false既定値false です。

解説解説
使用例使用例

SelectionProtected プロパティ使用して、RichTextBox 内で保護されるテキスト指定する方法次のコード例示します。この例では、richTextBox1 という名前の RichTextBox コントロールフォーム追加されており、その RichTextBox コントロールに "RichTextBox" という単語含まれるテキスト追加されている必要があります

Private Sub ProtectMySelectedText()
   ' Determine if the selected text in the control contains the word
 "RichTextBox".
   If richTextBox1.SelectedText <> "RichTextBox"
 Then
      ' Search for the word RichTextBox in the control.
      If richTextBox1.Find("RichTextBox",
 RichTextBoxFinds.WholeWord) = -1 Then
         'Alert the user that the word was not foun and return.
         MessageBox.Show("The text ""RichTextBox""
 was not found!")
         Return
      End If
   End If
   ' Protect the selected text in the control from being altered.
   richTextBox1.SelectionProtected = True
End Sub
private void ProtectMySelectedText()
{
   // Determine if the selected text in the control contains the word
 "RichTextBox".
   if(richTextBox1.SelectedText != "RichTextBox")
   {
      // Search for the word RichTextBox in the control.
      if(richTextBox1.Find("RichTextBox",RichTextBoxFinds.WholeWord)==
 -1)
      {
         //Alert the user that the word was not foun and return.
         MessageBox.Show("The text \"RichTextBox\" was not found!");
         return;
      }
   }
   // Protect the selected text in the control from being altered.
   richTextBox1.SelectionProtected = true;
}
private:
   void ProtectMySelectedText()
   {
      // Determine if the selected text in the control contains the word
 "RichTextBox".
      if (  !richTextBox1->SelectedText->Equals( "RichTextBox"
 ) )
      {
         // Search for the word RichTextBox in the control.
         if ( richTextBox1->Find( "RichTextBox",
 RichTextBoxFinds::WholeWord ) == -1 )
         {
            //Alert the user that the word was not foun and return.
            MessageBox::Show( "The text \"RichTextBox\" was not found!"
 );
            return;
         }
      }

      // Protect the selected text in the control from being altered.
      richTextBox1->SelectionProtected = true;
   }
private void ProtectMySelectedText()
{
    // Determine if the selected text in the control contains the word
 
    //"RichTextBox".
    if (richTextBox1.get_SelectedText().Equals("RichTextBox"))
 {
        // Search for the word RichTextBox in the control.
        if (richTextBox1.Find("RichTextBox",
            RichTextBoxFinds.WholeWord) == -1) {
            //Alert the user that the word was not foun and return.
            MessageBox.Show("The text \"RichTextBox\" was not found!");
            return;
        }
    }
    // Protect the selected text in the control from being altered.
    richTextBox1.set_SelectionProtected(true);
} //ProtectMySelectedText
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

RichTextBox.SelectionProtected プロパティのお隣キーワード
検索ランキング

   

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



RichTextBox.SelectionProtected プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS