How? By handling the event
RadioButton.CheckedChanged
event,
of course:
https://msdn.microsoft.com/en-us/library/system.windows.forms.radiobutton.checkedchanged%28v=vs.110%29.aspx[
^].
How to know what was checked before?
Of course, by recording some set of previous sets of some controls in some memory area, typically a queue. That's all.
Now, please listen carefully. It's hard to invent worse UI abuse and the worse way to confuse the user.
No, the user does not want your warning message, as well as any other brainwash. If the user clicks some radio button, that person means it. If something was selected by mistake, the users can see what is selected.
You are trying to create the behavior depending on history, and this is impossibly bad. Now, just think about it: your application "knows" that state, but the user cannot see it. The pretty good rule would be:
no hidden states.
You can warn the user of wrong choice, only when it is final. You can collect all the states of all relevant control and inform the user one the implications,
but only at the moment of time when the use of this choice is about to become irreversible.
—SA