I was wondering if there's any proper way of reading RadioButton that's checked from one GroupBox. So far I would create something along this lines per each GroupBox.
private int checkRadioButton() {
if (radioButtonKwartal1.Checked) {
return 1;
} else if (radioButtonKwartal2.Checked) {
return 2;
} else if (radioButtonKwartal3.Checked) {
return 3;
} else if (radioButtonKwartal4.Checked) {
return 4;
}
return 0;
}
Edit: there are some preety good answers but knowing which radioButton is pressed is one thing, but knowing the return value attached to it is 2nd. How can I achieve that? The code above lets me get return values which then I can use later in a program.