I created a simple Control Library, added a component and a form. Added the
following code to the component:
public DialogResult ShowDialog(IWin32Window owner)
{
frmTest test = new frmTest();
return test.ShowDialog(owner);
}
Created an Application project, referenced the component, and added it to
the Application form, added a button, with the following Click Handler:
private void button1_Click(object sender, System.EventArgs e)
{
myComponent1.ShowDialog(this);
}
Works fine for me, and follows the same general pattern of OpenFileDialog.
It sounds to me like you're trying to create the form in the component
constructor. If that's what you really want to do, why don't you test
against Component.DesignMode?