private void listBB_SelectedIndexChanged(object sender, EventArgs e) { if (listBB.Items.Count > 0 && listBB.SelectedIndices.Count > 0) { PartList.Part part = (PartList.Part)listBB.SelectedItems[0].Tag; if (splitContainer.Panel2.Controls.Count == 0) { var panel = new PartInfoPanel(); panel.Dock = DockStyle.Fill; splitContainer.Panel2.Controls.Add(panel); } ((PartInfoPanel)splitContainer.Panel2.Controls[0]).SetPart(part); } }
private void listBB_SelectedIndexChanged(object sender, EventArgs e) { if (partListBox.Items.Count > 0 && partListBox.SelectedIndices.Count > 0) { PartList.Part part = partListBox.SelectedParts[0]; if (partInfoPanel == null) { var panel = new PartInfoPanel(); panel.Dock = DockStyle.Fill; splitContainer.Panel2.Controls.Clear(); splitContainer.Panel2.Controls.Add(panel); partInfoPanel = panel; } partInfoPanel.SetPart(part); } }