My current project requires me to disable combo boxes from Form 2 when edit button is clicked in Form 1. What I would like to know is how I can disable a combo box that's in Form 2 from Form 1.
I tried
IDComboBox4.Enabled = false;
in Form 1 however I get and error that says
"The Name 'IDComboBox4' does not exist in the current context".
Update:
I attempted both answers however sadly neither worked. Now I get a syntax error
"An object reference is required for the non-static field, method, or property"
when trying code
dlgForm.ComboBox4Enabled = false;
in Form1 with code
public bool ComboBox4Enabled
{
get
{
return IDComboBox4.Enabled;
}
set
{
IDComboBox4.Enabled = value;
}
}
in Form2 which is also dlgForm. I feel like I'm overlooking something basic however just cant put my finger on it at the moment. If you would like some snippets of my code let me know. Any help is appreciated. Thanks again.