private void lvwPrint_Click(object sender, EventArgs e) { if (tsbExit.Visible) { gbxMiddle.Controls[1].Dispose(); tsbExit.Visible = false; } if (tsbExitPrint.Visible) { gbxMiddle.Controls[1].Dispose(); } tsbExitPrint.Visible = true; tsbErrorListSelect.Visible = false; txtErrorListSelect.Visible = false; gbxUp.Visible = false; gbxDown.Visible = false; dgvInfo.Visible = false; string tblName = lvwPrint.SelectedItems[0].ImageKey; switch (tblName) { case "Service": ucPrint ucService = new ucPrint(this._dstPrint.Tables[ lvwPrint.SelectedItems[0].Name], tblName); gbxMiddle.Controls.Add(ucService); ucService.Dock = DockStyle.Fill; break; case "Lift": ucPrint ucLift = new ucPrint(this._dstPrint.Tables[ lvwPrint.SelectedItems[0].Name], tblName); gbxMiddle.Controls.Add(ucLift); ucLift.Dock = DockStyle.Fill; break; default: break; } }