Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pass parameter to form constructor
Message
De
27/08/2007 07:21:55
 
 
À
26/08/2007 10:06:07
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
01250488
Message ID:
01250604
Vues:
17
Hi,

What's the exception?
Regards,
Viv

>Hi,
>I have problem to pass parameter to form constructor using Activator.CreateInstance().
>
>I have code below,
>
>Hi,
>I am facing the same problem.
>
>I tried the code below.
>
>
>            //Workign OK
>            Payment.UI.Windows.Forms.PaymentForm loForm = new PaymentForm(new object[]
>                { JK.Payment.Enums.TxnType.Sale, salesBO.SaleNo, salesBO.Total });
>
>            loForm.ShowDialog();
>
>            loForm.Dispose();
>
>            //Workign OK
>            loForm = (PaymentForm)Activator.CreateInstance(Type.GetType("JK.Payment.UI.Windows.Forms.PaymentForm"));
>
>            loForm.ShowDialog();
>
>            loForm.Dispose();
>
>            //NOT Workign OK
>            loForm = (PaymentForm) Activator.CreateInstance(Type.GetType("JK.Payment.UI.Windows.Forms.PaymentForm"),
>                                                            new object[]
>                                                                {
>                                                                    JK.Payment.Enums.TxnType.Sale, salesBO.SaleNo,
>                                                                    salesBO.Total
>                                                                });
>
>            loForm.ShowDialog();
>            loForm.Dispose();
>
>
>Please advice
>
>Thank you
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform