解决C#跳转界面问题
各路大神,由于初学还要赶,实在没办法,简单的问题也要问了,见效先,我的问题是:我用了combox,在combox中设置了毕业生,辅导员,管理员三个用户,我的每个用户在登录界面跳转到相应的主界面,我想知道具体怎么跳转过去,代码怎么写,具体步骤等,实在没办法了,分不多,我相信有好人在,
Form f=new Form(); switch (this.comboBox1.Text) { case "Form2": f = new Form2(); break; case "Form3": f = new Form3(); break; default : break; } f.ShowDialog();
在Program.cs中 Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frm_loadpg()); //使用登录窗体 if (Class1.flag == true) Application.Run(new frm_login()); switch (Class1.cmb_shenfennumber) { case 0: Application.Run(new frm_custom()); break; case 1: Application.Run(new frm_Supplier()); break; case 2: Application.Run(new frm_cashiermain()); break; case 3: Application.Run(new frm_purchase()); break; case 4: Application.Run(new frm_sell()); break; case 5: Application.Run(new frm_storehouse()); break; case 6: Application.Run(new frm_altogether()); break; }