首页 > 编程知识 正文

始终在新窗口中打开弹出窗口

时间:2023-05-05 03:06:09 阅读:204272 作者:1423

using System.Reflection;namespace WindowsFormsApp1{ public partial class Form1 : Form { int Value { get; set; } public Form1() { InitializeComponent(); } private void button_Click(object sender, EventArgs e) { label1.Text = ""; Assembly assembly = Assembly.GetExecutingAssembly(); try { Form f = assembly.CreateInstance("WindowsFormsApp1." + "Form" + textBox1.Text) as Form; f.ShowDialog(); } catch(System.NullReferenceException) { label1.Text = textBox1.Text + " not exist"; } } }}

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。