Hello All,
I am working on a .Net desktop application and I am having problem
displaying a form. I am using C# and version 1.1 of the framework. here
is how the code looks likes and I will appreciate if someone can tell
me how to resolve this problem.
Main ( Args )
{
Form1 f1 = new Form1();
Form2 f2 = new Form2();
Form1 f3 = new Form3();
//based on some passed paramter I decide which form to load
LoadForm(arg);
}
LoadForm( Args)
{
if Args[0] = "1"
f1.ProcessCommand(args); // I pass the paramters and the form
// loads itself and is activated.
// Same goes for all the other forms also.
if Args[0] = "2"
f2.ProcessCommand(args);
if Args[0] = "3"
f3.ProcessCommand(args);
}
Now this application is supposed to be running on the background even
if I close the form. This part is working OK.
When I am done using a form I call the Close() but I dont release the
resources used by the form as the user might load the same form again.
When I load any form, lets say f1 .. the application works with out any
problem. When I close the f1 using Close() and try to load lets say f2
the form f2 loads up but after the activate event only the borders
appears and the client area is all white as if the form is unable to
draw itself.
Please note I am using delegates in the the forms to show the form and
process the various events.
Also note all forms work using the design.i.e using delegates to invoke
methods.
When I run the application and load either of the three forms
everything works fine but when I try to load another form after using
one form this problem arises.
your help will be greatly appreciated.
Cheers...
Nad