One way is to save the bool flag with the name _changed or something like that as a member variable in your form. Then, in the TextChanged event of the TextBox and the SelectedIndexChanged event of the ComboBox, you simply set _changed = true.
Then, shortly before closing the form, you ask the user if _changed is true.
Edit:
If you have many TexBox controls on the form, you can connect them all to one TextChanged event handler. Then, no matter what TextBox text has changed, _changed will be set to true.
Then do the same with multiple ComboBox controls and one SelectedIndexChanged event.
If you really have a lot of controls, instead of manually connecting them manually, you can even write a method that recursively passes through the Controls collection of your form and intercepts each type of control to the corresponding event handler. Then you can reuse this method in more than one form to save a lot of time and money on maintenance, since when you add new controls, they will be automatically taken care of.
source share