申請書には 3 つのフォームがあります。
Form1 はメイン フォームです。Form2 は、2 つの入力フィールドを持つフォームです。Form3 は Form1 からトリガーされるパスワード確認フォームで、認証が成功すると Form2 が表示されます。
Form1 -> Form3 -> Form2
private void button1_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.textBox_entry_password.Text))
{
MessageBox.Show("Please enter a password", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
this.textBox_entry_password.Focus();
}
else
{
// Authentication not Implemented so far
Form Form2 = new Form2();
Form2.StartPosition = FormStartPosition.CenterScreen;
// Code for hiding Form3 -- Needed ????
Form2.ShowDialog();
}
Form1をそのままにして、Form3を非表示にし、Form2を表示したい.
this.hide()
Form1 を非表示にします。
私が試したら
Form Form3 = new Form3();
Form3.Hide();
それは何もしません。Form3はそこにとどまります。
Form3 を非表示にするにはどうすればよいですか?