Link to home
Start Free TrialLog in
Avatar of ukalyan
ukalyan

asked on

Convert a string to a method call

I have a form application with a "drop down list" and  "Select button".
There are 3 functions
void foo1()
{
 ...
}

void foo2()
{
...
}
void foo3()
{
...
}

Is it possible to:
1) Convert method names to string so that these strings can be added to "drop down list" as "foo1", "foo2", "foo3"
2) Once a value is selected in the drop down, is it possible to change the selected string to method call:
    i.e. "foo1" as foo1()
          "foo2" as foo2()
         "foo3" as foo3()

My basic understanding of C# says, it is not possible. But I want to find from experts, if there is a way to do this.

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of Cebik
Cebik
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial