using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Deckungsbeitrag { public partial class FormMSAuswahl : Form { public int s; public FormMSAuswahl() { InitializeComponent(); } private void radioButton2_CheckedChanged(object sender, EventArgs e) { RadioButton rb = (RadioButton)sender; if (rb.Checked) { rb.BackColor = Color.Green; s = int.Parse(rb.Text); if (MessageBox.Show($"Bist du sicher, dass du Waschstraße {s} bedienst?", "Frage", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { this.DialogResult = DialogResult.OK; this.Close(); } else { rb.BackColor = SystemColors.ButtonFace; rb.Checked = false; } } } } }