Hello,
I have Form1 - the main form with some controls including a button.
I have Form2 - the properties form with a combobox and button. The user can select the colors of a button in the combobox in Form2 and press "OK". What code should I add to "OK" so that the user can change the colors of a button in Form1
Mateusz

How to change control properties in Form1 from Form2?
mtnanhu
I hope your forms are not named Form1 and Form2 :-)
Keaven
PremK
public Color NewColor
{
get { return _newColor; }
}
private Color _newColor;
This variable is set within the dialog, by the end user selecting a color. Actually, there's a color dialog built in to Windows, are you using that, or how is a color being selected
In Form1
Form2 dlg = new Form2;
if (DialogResult.OK == dlg.ShowDialog())
{
this.theButton.BackColor = dlg.NewColor;
}
I'm going from memory, the property may not be called BackColor, but that's the general idea.