Немодальное диалоговое окно используется для обмена информацией с пользователем. В отличии от модального диалогового окна, оно позволяет выполнить другую задачу, т.е. одновременно могут быть открыты несколько немодальных окон.
Для отображения немодального диалогового окна используется метод Show().
Для отображения немодального диалогового окна используется метод Show().
FormNotModal1.cs
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespace_0018 {-
publicpartialclassFormNotModal1 : Form { -
publicFormNotModal1() { -
InitializeComponent(); -
} -
privatevoidbutton1_Click(objectsender, EventArgs e) { -
label2.Text = textBox1.Text; -
} -
} }
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespace_0018 {-
publicpartialclassFormNotModal1 : Form { -
publicFormNotModal1() { -
InitializeComponent(); -
} -
privatevoidbutton1_Click(objectsender, EventArgs e) { -
label2.Text = textBox1.Text; -
} -
} }
FormNotModal2.cs
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespace_0018 {-
publicpartialclassFormNotModal2 : _0018.FormNotModal1 { -
publicFormNotModal2() { -
InitializeComponent(); -
} -
privatevoidbutton1_Click(objectsender, EventArgs e) { -
label2.Text = textBox1.Text; -
} -
} }
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespace_0018 {-
publicpartialclassFormNotModal2 : _0018.FormNotModal1 { -
publicFormNotModal2() { -
InitializeComponent(); -
} -
privatevoidbutton1_Click(objectsender, EventArgs e) { -
label2.Text = textBox1.Text; -
} -
} }
Form1.cs
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespace_0018 {-
publicpartialclassForm1 : Form { -
publicForm1() { -
InitializeComponent(); -
} -
privatevoidbutton1_Click(objectsender, EventArgs e) { -
FormNotModal1 FNT1 =newFormNotModal1(); -
FNT1.Show(); -
//или -
//new FormNotModal1().Show(); -
} -
privatevoidbutton2_Click(objectsender, EventArgs e) { -
newFormNotModal2().Show(); -
//или -
//FormNotModal2 FNT2 = new FormNotModal2(); -
//FNT2.Show(); -
} -
} }
usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Threading.Tasks;usingSystem.Windows.Forms;namespace_0018 {-
publicpartialclassForm1 : Form { -
publicForm1() { -
InitializeComponent(); -
} -
privatevoidbutton1_Click(objectsender, EventArgs e) { -
FormNotModal1 FNT1 =newFormNotModal1(); -
FNT1.Show(); -
//или -
//new FormNotModal1().Show(); -
} -
privatevoidbutton2_Click(objectsender, EventArgs e) { -
newFormNotModal2().Show(); -
//или -
//FormNotModal2 FNT2 = new FormNotModal2(); -
//FNT2.Show(); -
} -
} }