private void button_Confirm_Click(object sender, EventArgs e) { HeroNum = CardListBox.SelectedIndex; DialogResult = DialogResult.OK; Close(); }