R
Ron Rohrssen
I want to show a dialog and when the form (dialog) is
closed, return to the calling form. The calling form
should then be able to pass the child form to another
object with the form as a parameter.
For example,
FormOptions formOptions = new FormOptions();
if (formOptions.ShowDialog(this) == DialogResult.OK)
{
ConfigurationManager configurationManager = new
ConfigurationManager();
configurationManager.saveConfiguration(formOptions);
}
formOptions.Dispose();
My ConfigurationManager has a method that looks like
this:
public void saveConfiguration(FormOptions formOptions)
{
ConfigurationData configurationData = new
ConfigurationData
(formOptions);
saveConfiguration(configurationData);
}
When I build this code I keep getting an error like this:
ConfigurationData.cs(20): The type or namespace
name 'FormOptions' could not be found (are you missing a
using directive or an assembly reference?)
These classes are all within the same namespace.
Is it possible to pass the form object to another class?
Or do I need to extract values from the form and pass
them on to my ConfigurationManager?
I've even tried qualifying the FormOptions class in my
parameter list as SCT.FormOptions. "SCT" is my namespace.
Intellisense doesn't see any of my forms when I try to
qualify the FormOptions class.
I suppose this is a pretty simple solution. But, it's
frustrating.
closed, return to the calling form. The calling form
should then be able to pass the child form to another
object with the form as a parameter.
For example,
FormOptions formOptions = new FormOptions();
if (formOptions.ShowDialog(this) == DialogResult.OK)
{
ConfigurationManager configurationManager = new
ConfigurationManager();
configurationManager.saveConfiguration(formOptions);
}
formOptions.Dispose();
My ConfigurationManager has a method that looks like
this:
public void saveConfiguration(FormOptions formOptions)
{
ConfigurationData configurationData = new
ConfigurationData
(formOptions);
saveConfiguration(configurationData);
}
When I build this code I keep getting an error like this:
ConfigurationData.cs(20): The type or namespace
name 'FormOptions' could not be found (are you missing a
using directive or an assembly reference?)
These classes are all within the same namespace.
Is it possible to pass the form object to another class?
Or do I need to extract values from the form and pass
them on to my ConfigurationManager?
I've even tried qualifying the FormOptions class in my
parameter list as SCT.FormOptions. "SCT" is my namespace.
Intellisense doesn't see any of my forms when I try to
qualify the FormOptions class.
I suppose this is a pretty simple solution. But, it's
frustrating.