Putting the save code in the calling form, in my opinion, puts it in the wrong place. Yes, it will work in this case, but this means that the settings form cannot be reused and that any error in your save code will disable the settings form before you know about any errors.
In addition, if you add a new parameter, you need to make changes to two sources, add controls (and initialize them) once in the settings form and save the values ββin the calling form once.
I would bind the code to the OK button of the settings form. If any errors occur during saving, you can inform the user while their changes are visible and can be restored. A form can be called from different places as needed, or moved only by moving the ShowDialog () call. Your DialogResult.OK processing should be used to update the call form, as changes apply to it.
source share