Two approaches:
Put properties on your preferences form and access them from the main form when the user clicks OK.
if (preferenceForm.ShowDialog() == DialogResult.OK)
{
this.Color = preferenceForm.UserSelectedColor;
//etc...
}
Send your preference form a delegate from the main form and let the preference form call it with the appropriate changes.
class FormSettings
{
object Color {get, set}
}
class MainForm
{
...
void ChangeSettings(FormSettings newSettings)
{ ... }
void EditPreferences_Click(...)
{
...
EditPreferencesForm editPreferences = new EditPreferencesForm(this.ChangeSettings)
editPreferences.ShowDialog();
}
}
class EditPreferencesForm
{
...
ChangeSettingsDelegate changeSettings;
FormSettings formSettings;
void OkButton_Click(...)
{
changeSettings(formSettings);
}
}