Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to call function that located in other Form using a
Message
 
 
To
02/10/2009 14:03:46
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MySQL
Application:
Desktop
Miscellaneous
Thread ID:
01427403
Message ID:
01427408
Views:
45
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
Previous
Reply
Map
View

Click here to load this message in the networking platform