private void next_Click(object sender, EventArgs e) { Control new_ctrl = null; switch (now) { case 0: { var box = new CheckSystem(); box.OnNav += new CheckSystem.NavHandler(NavHandler); new_ctrl = box; } break; case 1: { var box = new CheckVS15(); box.OnNav += new CheckVS15.NavHandler(NavHandler); new_ctrl = box; } break; case 2: { var box = new TP(); box.OnNav += new TP.NavHandler(NavHandler); new_ctrl = box; } break; case 3: { var box = new Finish(); box.OnNav += new Finish.NavHandler(NavHandler); new_ctrl = box; next.Text = "完成"; } break; case 4: { Close(); Environment.Exit(0); } break; default: { return; } break; } mainpanel.Controls.Clear(); Title.Text = title_list[now + 1]; new_ctrl.Dock = DockStyle.Fill; mainpanel.Controls.Add(new_ctrl); new_ctrl.BringToFront(); now++; }
private void prev_Click(object sender, EventArgs e) { Control new_ctrl = null; switch (now) { case 1: { var box = new Welcome(); box.OnNav += new Welcome.NavHandler(NavHandler); new_ctrl = box; } break; case 2: { var box = new CheckSystem(); box.OnNav += new CheckSystem.NavHandler(NavHandler); new_ctrl = box; } break; case 3: { var box = new CheckVS15(); box.OnNav += new CheckVS15.NavHandler(NavHandler); new_ctrl = box; } break; case 4: { var box = new TP(); box.OnNav += new TP.NavHandler(NavHandler); new_ctrl = box; } break; default: { return; } break; } mainpanel.Controls.Clear(); Title.Text = title_list[now - 1]; new_ctrl.Dock = DockStyle.Fill; mainpanel.Controls.Add(new_ctrl); new_ctrl.BringToFront(); now--; }