このコードを使用して、MdiWindow でフォームを作成および表示しました。
if (currentForm != null) {
currentForm.Dispose();
}
currentForm = new ManageCompanies();
currentForm.MdiParent = this;
currentForm.Show();
currentForm.WindowState = FormWindowState.Maximized;
このコードを使用して、約 20 の異なるフォームを表示しました...
私はそのような関数を書きたい:
private void ShowForm(formClassName) {
if (currentForm != null) {
currentForm.Dispose();
}
currentForm = new formClassName();
currentForm.MdiParent = this;
currentForm.Show();
currentForm.WindowState = FormWindowState.Maximized;
}
formClassName を文字列などとして送信する必要がありますか? そしてそれをコードに含める方法...最終的なコードが欲しい...