private void serverStats_Click(object sender, EventArgs e) { serverstatsForm serverform = new serverstatsForm(); ListView.SelectedListViewItemCollection server = this.serverList.SelectedItems; foreach (ListViewItem item in server) { string IP1 = item.SubItems[1].Text; selectedIP1 = IP1; } serverform.ShowDialog(); }