Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to call function that located in other Form using a
Message
 
 
À
02/10/2009 14:03:46
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MySQL
Application:
Desktop
Divers
Thread ID:
01427403
Message ID:
01427408
Vues:
46
Winan,

Can you create a separate public Helper class in App_Code directory with this function? If this would be a static class, you would be able to call its function from any form.

>Dear All,
>
>How to call function that located in other Form using a string?
>
>I have function calculatesummary(double pPrice, int pUnit), its located on Form2 ..
>
>and I want to call it from Form1 using a string .. is it possible ?
>
>ie.
>
>double mPrice = 1000;
>int mUnit=5;
>
>string mCallFunction = "calculatesummary" --> located in Form2
>
>Type mType = Type.GetType("MyProject1.Form2");
>System.Reflection.MethodInfo theMethod = mType.GetMethod(mCallFunction)
>theMethod.Invoke( ........... ??? -> what ?
>
>??? .. I am confusing .. how to call it from Form1? ..
>
>please help
>
>Thanks & Regards
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform