Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to open last form in MDI application start
Message
From
20/04/2007 17:41:03
 
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01216062
Message ID:
01218524
Views:
16
>Leaving aside where you decide to store the information you can use something like the following to recreate the form:
>
>string s = LastFormReference.GetType().FullName;
>//Save s then on startup use it thus:
>Form lf =   (Form) System.Activator.CreateInstance(Type.GetType(s));
>
>But you wanted to retain parameter values as well and you can't pass parameters with CreateInstance which is why I suggested serializing the form. If you use XML serialization only public properties are serialized and since forms tend not to have a large public interface it should be easy to keep the XML pretty small.

Viv,

thank you.

Which is better style: use parameterized constructor for forms or not to use ?
I think I must use only constructurs without parameters. I can read parameters from isolated storage also and then after yourt code use

lf.Configure( param1, param2 )
Andrus
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform