Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
実行時にフォームを作成し、それにコントロールを追加してハンドラーに接続する方法を知っています...知りたいのは、このフォーム内のコントロールをコンテナフォームと反応させて、たとえばフォームを閉じる方法です。 ?
より明確にするために、スタートアップフォームをボタンで閉じたい場合は、必要なハンドラーに次のコードを追加するだけです。
Me.Close()
次に、ランタイムで作成されたフォームを閉じるには、「Me」の代わりに何を書く必要がありますか?!
前もって感謝します。
Meの代わりに、ランタイムで作成されたフォームを参照する変数を使用します。
例えば:
Dim customform As New Form() ' add some controls here before showing the form customform.Show() ' when you're done with the form customform.Close()