Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to open last form in MDI application start
Message
De
20/04/2007 17:41:03
 
 
À
17/04/2007 05:20:23
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01216062
Message ID:
01218524
Vues:
17
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform