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

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

Form.ActiveForm プロパティ

アプリケーションで現在アクティブフォーム取得します

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

解説解説
使用例使用例

アクティブフォーム取得し、そのフォーム上のすべてのコントロール無効にするコード例次に示します。この例では、フォームControls コレクション使用してフォーム上のコントロール反復処理して、それぞれ無効にます。

Public Sub DisableActiveFormControls()
    ' Create an instance of a form and assign it the currently active
 form.
    Dim currentForm As Form = Form.ActiveForm
    
    ' Loop through all the controls on the active form.
    Dim i As Integer
    For i = 0 To currentForm.Controls.Count
 - 1
        ' Disable each control in the active form's control collection.
        currentForm.Controls(i).Enabled = False
    Next i
End Sub 'DisableActiveFormControls
public void DisableActiveFormControls()
 {
    // Create an instance of a form and assign it the currently active
 form.
    Form currentForm = Form.ActiveForm;
    
    // Loop through all the controls on the active form.
    for (int i = 0; i < currentForm.Controls.Count;
 i++)
    {
       // Disable each control in the active form's control collection.
       currentForm.Controls[i].Enabled = false;
    }
 }
    
void DisableActiveFormControls()
{
   
   // Create an instance of a form and assign it the currently active
 form.
   Form^ currentForm = Form::ActiveForm;
   
   // Loop through all the controls on the active form.
   for ( int i = 0; i < currentForm->Controls->Count;
 i++ )
   {
      
      // Disable each control in the active form's control collection.
      currentForm->Controls[ i ]->Enabled = false;

   }
}

public void DisableActiveFormControls()
{
    // Create an instance of a form and assign it the currently 
    // active form.
    Form currentForm = Form.get_ActiveForm();

    // Loop through all the controls on the active form.
    for (int i = 0; i < currentForm.get_Controls().get_Count();
 i++) {
        // Disable each control in the active form's control collection.
        currentForm.get_Controls().get_Item(i).set_Enabled(false);
    }
} //DisableActiveFormControls
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「Form.ActiveForm プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS