Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Execution of string variable containing form name
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00790231
Message ID:
00841706
Vues:
36
What makes rick's code difficult is that he is dynamically compiling code on the fly. If the code is already compiled somewhere on disk, the process is relatively easy.

//1. Get a reference to the assembly where the class lives
Assembly asm = Assembly.GetExecutingAssembly();
//2. Instantiate the class
Form f = (Form)asm.CreateInstance("Reflection.Form1");
//3. Execute it
Application.Run(f);


>Dan,
>
>>>I gotta reread that when I'm sober. What a mind-job. There has got to be a simpler way!<
>
>Let us all know if you find one!! =)
>
>~~Bonnie
>
>
>>>Bob,
>>>
>>>It can be done, although it's not trivial as it was in VFP. See Rick's article on the subject at http://www.west-wind.com/presentations/DynamicCode/DynamicCode.htm
>>>
>>>~~Bonnie
>>>
>>>
>>
>>Jeebus.
>>
>>I gotta reread that when I'm sober. What a mind-job. There has got to be a simpler way!
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform