private void listView_SelectedIndexChanged(object sender, EventArgs e) { if (listView.FocusedItem != null) { if (listView.SelectedItems != null && listView.SelectedItems.Count > 0) { //message = listView.SelectedItems[0].Text+listView.SelectedItems[0].Index.ToString(); //string message ="no item select"; //string caption = "no server name specified"; //MessageBoxButtons buttons = MessageBoxButtons.OK; //DialogResult result; //// displays the messagebox. //result = MessageBox.Show(this, message, caption, buttons, //MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);//,MessageBoxOptions.); //if (result == DialogResult.Yes) //{ // //do your action here. //} panelShow = (PanelShowType)listView.SelectedItems[0].Index; ShowPanel((PanelShowType)listView.SelectedItems[0].Index); } } }
private void ShowPanel(PanelShowType showType) { System.Windows.Forms.Panel[] panels = new Panel[] { panelSource,panelIndexSet,panelIndexerSet,panelSearchd,panelDictionary}; foreach(Panel panel in panels) { panel.Visible = false; } panels[(int)showType].Visible = true; }