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

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

TextBoxBase.Modified プロパティ

コントロール作成されてから、またはコントロール最後に設定されてから、ユーザーテキスト ボックス コントロール変更したかどうかを示す値を取得または設定します

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

解説解説
使用例使用例

派生クラス TextBox の TextChanged イベント使用してコントロールデータ入力されてから TextBox コントロール内容変更されたかどうかを判断するコード例次に示します。この例では、コントロールの元の内容格納している文字列使用して、その文字列TextBox内容比較し内容変更されたかどうかを判断します内容変更され場合は、Modified プロパティtrue設定されます。それ以外場合falseリセットされます。この例では、textBox1 という名前の TextBox コントロール作成されており、TextBox コントロールの元のテキスト格納するために originalText という名前の String 変数作成されている必要があります

Private Sub TextBox1_TextChanged(sender As
 Object, e As EventArgs)
    ' Check to see if the change made does not return the
    ' control to its original state. 
    If originalText <> textBox1.Text Then
        ' Set the Modified property to true to reflect the change.
        textBox1.Modified = True
        ' Contents of textBox1 have not changed, reset the Modified
 property.
    Else
        textBox1.Modified = False
    End If
End Sub

private void TextBox1_TextChanged(object sender,
 EventArgs e)
 {
    /* Check to see if the change made does not return
 the
       control to its original state. */
    if (originalText != textBox1.Text)
       // Set the Modified property to true to reflect the change.
       textBox1.Modified = true;
    else
       // Contents of textBox1 have not changed, reset the Modified
 property.
       textBox1.Modified = false;
 }
 
private:
   void TextBox1_TextChanged( Object^ sender, EventArgs^ e )
   {
      /* Check to see if the change made does not return
 the
         control to its original state. */
      if ( originalText != textBox1->Text )
      {
         // Set the Modified property to true to reflect the change.
         textBox1->Modified = true;
      }
      else
      {
         // Contents of textBox1 have not changed, reset the Modified
 property.
         textBox1->Modified = false;
      }
   }
private void textBox1_TextChanged(Object sender,
 EventArgs e)
{
    /* Check to see if the change made does not return
 the
       control to its original state. 
     */
    if (!(originalText.Equals(textBox1.get_Text()))) {
        // Set the Modified property to true to reflect the change.
        textBox1.set_Modified(true);
    }
    else {
        // Contents of textBox1 have not changed,
        // reset the Modified property.
        textBox1.set_Modified(false);
    }
} //TextBox1_TextChanged 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からTextBoxBase.Modified プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からTextBoxBase.Modified プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からTextBoxBase.Modified プロパティ を検索

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

辞書ショートカット

すべての辞書の索引

「TextBoxBase.Modified プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS