G
Guest
Hello,
I built a very basic form (System.Windows.Forms.Form) in a project that I
compiled as a class library. Everything worked fine.
I then created another project and I want to display that form in it.
Problem is that when I create an instance of the form and then try to set it
as being visible, the form is blank. There is no controls on it, nothing.
It looks like the creation process is not done. It looks frozen. I think I
might have to create the form and have it run on another thread but I'm not
sure and before going into these kinds of modifications, I wanted to be sure
that that was my problem.
The code that instantiates the form is very simple:
class RunTest
{
[STAThread]
static void Main(string[] args)
{
MyFormNamespace.MyForm o = new MyFormNamespace.MyForm();
Console.WriteLine(o.Test());
Console.ReadLine();
}
}
The only thing needed is a reference to the project (or dll assembly)
containing the source. The 'Test()' method returns a string and is only used
for debugging purposes.
Any ideas? Do I need to create/run the form's process on a seperate thread?
How can I do this easily?
Thanks a lot in advance,
Skip
I built a very basic form (System.Windows.Forms.Form) in a project that I
compiled as a class library. Everything worked fine.
I then created another project and I want to display that form in it.
Problem is that when I create an instance of the form and then try to set it
as being visible, the form is blank. There is no controls on it, nothing.
It looks like the creation process is not done. It looks frozen. I think I
might have to create the form and have it run on another thread but I'm not
sure and before going into these kinds of modifications, I wanted to be sure
that that was my problem.
The code that instantiates the form is very simple:
class RunTest
{
[STAThread]
static void Main(string[] args)
{
MyFormNamespace.MyForm o = new MyFormNamespace.MyForm();
Console.WriteLine(o.Test());
Console.ReadLine();
}
}
The only thing needed is a reference to the project (or dll assembly)
containing the source. The 'Test()' method returns a string and is only used
for debugging purposes.
Any ideas? Do I need to create/run the form's process on a seperate thread?
How can I do this easily?
Thanks a lot in advance,
Skip