example:
// form classes:
// ItemEditor
// CategoryEditor
private void OpenForm(string formClassName)
{
// I want to be able to instantiate a form based on the parameter.
if (formClassName == "ItemEditor" )
ItemEditor editor = new ItemEditor();
else if (formClassName == "CategoryEditor")
CategoryEditor editor = new CategoryEditor();
// (formClassName) editor = new (formClassName); // something like this.
editor.Show();
}
I think this may work, but this has hard-coding issues. Is there a way to
evaluate the formClassName without having to use multiple IF conditions?